Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorage ¶
func NewStorage() (Storage, DestroyFunc, error)
NewStorage initialize a new storage client
Types ¶
type DestroyFunc ¶
type DestroyFunc func()
DestroyFunc is to destroy any resources used by the storage returned in Create() together.
type Storage ¶
type Storage interface { Create(ctx context.Context, key string, data []byte, ttl int64) error Delete(ctx context.Context, key string) error Update(ctx context.Context, key string, data []byte) error Get(ctx context.Context, key string) ([]byte, error) List(ctx context.Context, key string) ([][]byte, error) Watch(ctx context.Context, key string, codec codec.Codec) (Watcher, error) Close() error }
Storage defines the interface of a storage client
type WatchEvent ¶
WatchEvent defines events during a watch
type Watcher ¶
type Watcher interface { Stop() ResultChan() <-chan WatchEvent }
Watcher defines a watcher interface
Click to show internal directories.
Click to hide internal directories.