-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
caa17ce
commit 57bfad4
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |