From 57bfad4aeef57d5375c4cef789c60952fbbd1778 Mon Sep 17 00:00:00 2001 From: Kelsey Hightower Date: Sun, 19 Oct 2014 01:21:45 -0700 Subject: [PATCH] add comments --- backend/backend.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 }