Browse Source

Merge pull request #14 from spikecurtis/etcd-atomic-create

Support "Atomic Create" in etcd
Alexandre Beslic 10 năm trước cách đây
mục cha
commit
638eb1907e

+ 2 - 1
libnetwork/internal/kvstore/kvstore.go

@@ -77,7 +77,8 @@ type Store interface {
 	// DeleteTree deletes a range of keys under a given directory
 	// DeleteTree deletes a range of keys under a given directory
 	DeleteTree(directory string) error
 	DeleteTree(directory string) error
 
 
-	// Atomic operation on a single value
+	// Atomic CAS operation on a single value.
+	// Pass previous = nil to create a new key.
 	AtomicPut(key string, value []byte, previous *KVPair, options *WriteOptions) (bool, *KVPair, error)
 	AtomicPut(key string, value []byte, previous *KVPair, options *WriteOptions) (bool, *KVPair, error)
 
 
 	// Atomic delete of a single value
 	// Atomic delete of a single value