Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNoRecord = errors.New("no key found")
ErrorNoRecord ...
Functions ¶
This section is empty.
Types ¶
type EtcdConfig ¶
type EtcdConfig struct {
Endpoints []string
}
EtcdConfig defines etcd store configuration info
type Manager ¶
type Manager interface { Close() error // General-purpose collection/key/value storage Put(ctx context.Context, collection string, key string, value []byte, ttlSeconds int64) error Delete(ctx context.Context, collection string, key string) error // Watch a collection for changes Watch(ctx context.Context, collection string) <-chan WatchResult // Watch a key for changes WatchKey(ctx context.Context, collection, key string) <-chan WatchResult Get(ctx context.Context, collection string, key string) ([]byte, error) Exists(ctx context.Context, collection string, key string) (bool, error) List(cctx context.Context, collection string, limit, page int64, newestFirst bool) ([]Result, int64, error) }
Manager defines a general interface for managing objects
func NewETCDManager ¶
func NewETCDManager(ctx context.Context, config EtcdConfig) (Manager, error)
NewETCDManager returns etcd store implementation
func NewETCDMockManager ¶
NewETCDMockManager returns a manager suitable for test environments.
type OperationType ¶
type OperationType int32
OperationType is the type of operation performed on a record
const ( // OperationTypePUT Represents PUT storage operations OperationTypePUT OperationType = 0 // OperationTypeDELETE Represents DELETE storage operations OperationTypeDELETE OperationType = 1 )
type WatchResult ¶
type WatchResult struct { Result Result Type OperationType Err error }
WatchResult represents changes in a watched collection
Click to show internal directories.
Click to hide internal directories.