feat(deps): bump plugins/store/nats-js-kv
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
+15
-1
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user