diff options
author | Valery Piashchynski <[email protected]> | 2021-06-09 14:24:04 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-09 14:24:04 +0300 |
commit | 8fdf05d4f360a9f6344141b273eab9d6859470e0 (patch) | |
tree | e4fc512aae21136d897832591cf25ccbb176e9af /plugins/kv/rpc.go | |
parent | a723cedba199a1c50dca05630b53139ee456ace8 (diff) | |
parent | 05e7925fbecb3e9f41f1a07fa459046ad0b16fc7 (diff) |
#714 feat(logger): file logger with log rotation support
#714 feat(logger): file logger with log rotation support
Diffstat (limited to 'plugins/kv/rpc.go')
-rw-r--r-- | plugins/kv/rpc.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/kv/rpc.go b/plugins/kv/rpc.go index a9efe0c4..557d3ee1 100644 --- a/plugins/kv/rpc.go +++ b/plugins/kv/rpc.go @@ -16,11 +16,11 @@ type rpc struct { log logger.Logger } -// Has accept []*payload.Payload proto payload with Storage and Item +// Has accept []*kvv1.Payload proto payload with Storage and Item func (r *rpc) Has(in *kvv1.Payload, res *map[string]bool) error { const op = errors.Op("rpc_has") - if in.Storage == "" { + if in.GetStorage() == "" { return errors.E(op, errors.Str("no storage provided")) } @@ -30,10 +30,10 @@ func (r *rpc) Has(in *kvv1.Payload, res *map[string]bool) error { keys = append(keys, in.Items[i].Key) } - if st, ok := r.storages[in.Storage]; ok { + if st, ok := r.storages[in.GetStorage()]; ok { ret, err := st.Has(keys...) if err != nil { - return err + return errors.E(op, err) } // update the value in the pointer @@ -52,7 +52,7 @@ func (r *rpc) Set(in *kvv1.Payload, ok *bool) error { if st, exists := r.storages[in.GetStorage()]; exists { err := st.Set(in.GetItems()...) if err != nil { - return err + return errors.E(op, err) } // save the result @@ -77,7 +77,7 @@ func (r *rpc) MGet(in *kvv1.Payload, res *map[string]interface{}) error { if st, exists := r.storages[in.GetStorage()]; exists { ret, err := st.MGet(keys...) if err != nil { - return err + return errors.E(op, err) } // save the result @@ -119,7 +119,7 @@ func (r *rpc) TTL(in *kvv1.Payload, res *map[string]interface{}) error { if st, exists := r.storages[in.GetStorage()]; exists { ret, err := st.TTL(keys...) if err != nil { - return err + return errors.E(op, err) } // save the result |