added etcd kv
This commit is contained in:
parent
ce7d138c60
commit
fd9f8fc1fd
8 changed files with 54 additions and 71 deletions
|
|
@ -18,10 +18,10 @@ type kv struct {
|
|||
r *raft.Raft
|
||||
}
|
||||
|
||||
func (kv *kv) Get(k string) []byte {
|
||||
func (kv *kv) Get(k string) ([]byte, error) {
|
||||
kv.mu.Lock()
|
||||
defer kv.mu.Unlock()
|
||||
return kv.m[k]
|
||||
return kv.m[k], nil
|
||||
}
|
||||
|
||||
func (kv *kv) Set(k string, v []byte) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue