From 03f2bcbca21ed888d68530b6e34d53f64c89e4ee Mon Sep 17 00:00:00 2001 From: Francesco Montorsi <165799982+fmontorsi-equinix@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:00:14 +0200 Subject: [PATCH] [IMPROVED] Mention TTL in the Update function (#1727) --- 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