feat(deps): bump plugins/store/nats-js-kv

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-07-17 15:26:49 +02:00
parent 60d4305bab
commit 6d7d18adce
6 changed files with 25 additions and 8 deletions
+15 -1
View File
@@ -335,6 +335,20 @@ func (n *natsStore) String() string {
return "NATS JetStream KeyValueStore"
}
// WatchAll exposes the watcher interface from the underlying JetStreamContext.
func (n *natsStore) WatchAll(bucket string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) {
if bucket == "" {
return nil, errors.New("multi bucket watching is not supported")
}
b, err := n.js.KeyValue(bucket)
if err != nil {
return nil, errors.Wrap(err, "Failed to get bucket")
}
return b.WatchAll(opts...)
}
// thread safe way to initialize the connection.
func (n *natsStore) initConn() error {
if n.hasConn() {
@@ -397,7 +411,7 @@ func (n *natsStore) mustGetBucket(kv *nats.KeyValueConfig) (nats.KeyValue, error
func (n *natsStore) getRecord(bucket nats.KeyValue, key string) (*store.Record, bool, error) {
obj, err := bucket.Get(key)
if errors.Is(err, nats.ErrKeyNotFound) {
return nil, false, nil
return nil, false, store.ErrNotFound
} else if err != nil {
return nil, false, errors.Wrap(err, "Failed to get object from bucket")
}