Skip to content

Commit

Permalink
[IMPROVED] Mention TTL in the Update function (#1727)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmontorsi-equinix authored and piotrpio committed Dec 13, 2024
1 parent cc03d25 commit d70056e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions jetstream/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d70056e

Please sign in to comment.