From 4e3c53a1363f6f5c51fa6f0dbe3a79ea27034d6f Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Thu, 17 Oct 2024 09:46:23 +0000 Subject: [PATCH] Mention TTL in the Update function --- jetstream/kv.go | 1 + kv.go | 1 + 2 files changed, 2 insertions(+) diff --git a/jetstream/kv.go b/jetstream/kv.go index ae892b4d7..91a1bdcef 100644 --- a/jetstream/kv.go +++ b/jetstream/kv.go @@ -123,6 +123,7 @@ type ( // Update will update the value if the latest revision matches. // If the provided revision is not the latest, Update will return an error. + // Update also resets the TTL associated with the key (if any). Update(ctx context.Context, key string, value []byte, revision uint64) (uint64, error) // Delete will place a delete marker and leave all revisions. A history diff --git a/kv.go b/kv.go index 4e7a3fdec..3cade1f82 100644 --- a/kv.go +++ b/kv.go @@ -54,6 +54,7 @@ type KeyValue interface { // Create will add the key/value pair iff it does not exist. Create(key string, value []byte) (revision uint64, err error) // Update will update the value iff the latest revision matches. + // Update also resets the TTL associated with the key (if any). Update(key string, value []byte, last uint64) (revision uint64, err error) // Delete will place a delete marker and leave all revisions. Delete(key string, opts ...DeleteOpt) error