Get returns the latest value for the key.
(ctx context.Context, key string)
| 1002 | |
| 1003 | // Get returns the latest value for the key. |
| 1004 | func (kv *kvs) Get(ctx context.Context, key string) (KeyValueEntry, error) { |
| 1005 | e, err := kv.get(ctx, key, kvLatestRevision) |
| 1006 | if err != nil { |
| 1007 | if errors.Is(err, ErrKeyDeleted) { |
| 1008 | return nil, ErrKeyNotFound |
| 1009 | } |
| 1010 | return nil, err |
| 1011 | } |
| 1012 | |
| 1013 | return e, nil |
| 1014 | } |
| 1015 | |
| 1016 | // GetRevision returns a specific revision value for the key. |
| 1017 | func (kv *kvs) GetRevision(ctx context.Context, key string, revision uint64) (KeyValueEntry, error) { |