Documentation
¶
Index ¶
- Variables
- func NewKv(name string) *kvstore
- type KeyStream
- type KvStore
- type KvStoreClient
- func (s *KvStoreClient) Delete(ctx context.Context, key string) error
- func (s *KvStoreClient) Get(ctx context.Context, key string) (map[string]interface{}, error)
- func (s *KvStoreClient) Keys(ctx context.Context, opts ...ScanKeysOption) (*KeyStream, error)
- func (s *KvStoreClient) Name() string
- func (s *KvStoreClient) Set(ctx context.Context, key string, value map[string]interface{}) error
- type KvStoreClientIface
- type KvStorePermission
- type ScanKeysOption
- type ScanKeysRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var KvStoreEverything []KvStorePermission = []KvStorePermission{KvStoreSet, KvStoreGet, KvStoreDelete}
Functions ¶
Types ¶
type KeyStream ¶
type KeyStream struct {
// contains filtered or unexported fields
}
TODO: maybe move keystream to separate file
type KvStore ¶
type KvStore interface {
// Allow requests the given permissions to the key/value store.
Allow(permission KvStorePermission, permissions ...KvStorePermission) KvStoreClientIface
}
type KvStoreClient ¶
type KvStoreClient struct {
// contains filtered or unexported fields
}
func NewKvStoreClient ¶
func NewKvStoreClient(name string) (*KvStoreClient, error)
func (*KvStoreClient) Delete ¶
func (s *KvStoreClient) Delete(ctx context.Context, key string) error
func (*KvStoreClient) Keys ¶
func (s *KvStoreClient) Keys(ctx context.Context, opts ...ScanKeysOption) (*KeyStream, error)
func (*KvStoreClient) Name ¶
func (s *KvStoreClient) Name() string
type KvStoreClientIface ¶
type KvStoreClientIface interface {
// Name - The name of the store
Name() string
// Get a value from the store
Get(ctx context.Context, key string) (map[string]interface{}, error)
// Set a value in the store
Set(ctx context.Context, key string, value map[string]interface{}) error
// Delete a value from the store
Delete(ctx context.Context, key string) error
// Return an async iterable of keys in the store
Keys(ctx context.Context, options ...ScanKeysOption) (*KeyStream, error)
}
type KvStorePermission ¶
type KvStorePermission string
const ( KvStoreSet KvStorePermission = "set" KvStoreGet KvStorePermission = "get" KvStoreDelete KvStorePermission = "delete" )
type ScanKeysOption ¶
type ScanKeysOption = func(*ScanKeysRequest)
func WithPrefix ¶
func WithPrefix(prefix string) ScanKeysOption
Apply a prefix to the scan keys request
type ScanKeysRequest ¶
type ScanKeysRequest = v1.KvStoreScanKeysRequest
Click to show internal directories.
Click to hide internal directories.