diff --git a/backend/backend.go b/backend/backend.go index 7d0d56aa..82d61d29 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -1,12 +1,20 @@ package backend +// Response represents a response from a backend store. type Response struct { Value []byte Error error } +// A Store is a K/V store backend that retrieves and sets, and monitors +// data in a K/V store. type Store interface { + // Get retrieves a value from a K/V store for the provided key. Get(key string) ([]byte, error) + + // Set sets the provided key to value. Set(key string, value []byte) error + + // Watch monitors a K/V store for changes to key. Watch(key string, stop chan bool) <-chan *Response }