Documentation
¶
Index ¶
Constants ¶
View Source
const Timeout = time.Second * 30
Timeout defines the default database dial timeout.
Variables ¶
View Source
var ( ErrWatchCanceled = errors.New("watch canceled by the server") ErrWatchClosed = errors.New("watch closed by the client") )
View Source
var ErrKeyNotFound = errors.New("key not found")
Functions ¶
This section is empty.
Types ¶
type Storer ¶
type Storer interface { Put(string, []byte) (int64, error) Get(string) ([]byte, int64, error) GetKeysWithPrefix(string) ([]string, error) Delete(string) error Watcher(context.Context, string) Watcher }
Storer defines behaviour all storage implementations must have.
type Watcher ¶
type Watcher interface { // Start starts watching specified resource. Start() // Stop stops the watcher. Stop() // EventChan returns events as they occur. EventChan() <-chan *Event // ErrChan returns an error, if any. The watcher is terminated on // receiving an error. ErrChan() <-chan error }
Watcher defines behaviour all watchers must have.
Click to show internal directories.
Click to hide internal directories.