Documentation ¶
Index ¶
- Constants
- 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) 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 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) }
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
Click to show internal directories.
Click to hide internal directories.