Documentation ¶
Index ¶
- Constants
- type FakeKVStore
- func (f *FakeKVStore) Del(ctx context.Context, orgId int64, namespace string, key string) error
- func (f *FakeKVStore) DeletionError(shouldErr bool)
- func (f *FakeKVStore) Get(ctx context.Context, orgId int64, namespace string, key string) (string, bool, error)
- func (f *FakeKVStore) GetAll(ctx context.Context, orgId int64, namespace string) (map[int64]map[string]string, error)
- func (f *FakeKVStore) Keys(ctx context.Context, orgId int64, namespace string, keyPrefix string) ([]Key, error)
- func (f *FakeKVStore) Set(ctx context.Context, orgId int64, namespace string, key string, value string) error
- type Item
- type KVStore
- type Key
- type NamespacedKVStore
- func (kv *NamespacedKVStore) Del(ctx context.Context, key string) error
- func (kv *NamespacedKVStore) Get(ctx context.Context, key string) (string, bool, error)
- func (kv *NamespacedKVStore) GetAll(ctx context.Context) (map[int64]map[string]string, error)
- func (kv *NamespacedKVStore) Keys(ctx context.Context, keyPrefix string) ([]Key, error)
- func (kv *NamespacedKVStore) Set(ctx context.Context, key string, value string) error
Constants ¶
View Source
const (
// Wildcard to query all organizations
AllOrganizations = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeKVStore ¶
type FakeKVStore struct {
// contains filtered or unexported fields
}
In memory kv store used for testing
func NewFakeKVStore ¶
func NewFakeKVStore() *FakeKVStore
func (*FakeKVStore) DeletionError ¶
func (f *FakeKVStore) DeletionError(shouldErr bool)
type Item ¶
type Item struct { Id int64 OrgId *int64 Namespace *string Key *string Value string Created time.Time Updated time.Time }
Item stored in k/v store.
type KVStore ¶
type KVStore interface { Get(ctx context.Context, orgId int64, namespace string, key string) (string, bool, error) Set(ctx context.Context, orgId int64, namespace string, key string, value string) error Del(ctx context.Context, orgId int64, namespace string, key string) error Keys(ctx context.Context, orgId int64, namespace string, keyPrefix string) ([]Key, error) GetAll(ctx context.Context, orgId int64, namespace string) (map[int64]map[string]string, error) }
KVStore is an interface for k/v store.
func ProvideService ¶
type NamespacedKVStore ¶
type NamespacedKVStore struct {
// contains filtered or unexported fields
}
NamespacedKVStore is a KVStore wrapper with fixed orgId and namespace.
func WithNamespace ¶
func WithNamespace(kv KVStore, orgId int64, namespace string) *NamespacedKVStore
WithNamespace returns a kvstore wrapper with fixed orgId and namespace.
func (*NamespacedKVStore) Del ¶
func (kv *NamespacedKVStore) Del(ctx context.Context, key string) error
func (*NamespacedKVStore) GetAll ¶
GetAll returns all the keys and values stored per organization. It returns a map of org -> key -> value.
Click to show internal directories.
Click to hide internal directories.