Documentation
¶
Index ¶
- func ConstructSchemaKeyForCollection(s *Store, col essence.Collection) string
- func DeconstructSchemaKey(schemaKey string) (namespace string, kind string, collectionName string)
- func LongToShort(long string) string
- type CollectionMap
- type KeyValueCollection
- func (kv *KeyValueCollection) All(ctx context.Context) map[string][]byte
- func (kv *KeyValueCollection) Destroy(ctx context.Context) error
- func (kv *KeyValueCollection) Get(ctx context.Context, shortKey string) ([]byte, error)
- func (kv *KeyValueCollection) Keys(ctx context.Context) []string
- func (c *KeyValueCollection) Keyspace() string
- func (c *KeyValueCollection) Kind() string
- func (c *KeyValueCollection) Name() string
- func (c *KeyValueCollection) SchemaKey() string
- func (kv *KeyValueCollection) Set(ctx context.Context, shortKey string, v []byte) error
- func (c *KeyValueCollection) Store() essence.Store
- type ListCollection
- func (lc *ListCollection) All(ctx context.Context) [][]byte
- func (lc *ListCollection) Destroy(ctx context.Context) error
- func (lc *ListCollection) Head(ctx context.Context) ([]byte, error)
- func (c *ListCollection) Keyspace() string
- func (c *ListCollection) Kind() string
- func (c *ListCollection) Name() string
- func (lc *ListCollection) Pop(ctx context.Context) ([]byte, error)
- func (lc *ListCollection) Push(ctx context.Context, val []byte) error
- func (c *ListCollection) SchemaKey() string
- func (lc *ListCollection) Shift(ctx context.Context) ([]byte, error)
- func (lc *ListCollection) Size(ctx context.Context) int
- func (c *ListCollection) Store() essence.Store
- func (lc *ListCollection) Tail(ctx context.Context) ([]byte, error)
- func (lc *ListCollection) Unshift(ctx context.Context, val []byte) error
- type Store
- func (s *Store) CollectionExists(ctx context.Context, kind, name string) bool
- func (s *Store) Destroy(ctx context.Context) error
- func (s *Store) KeyValueCollection(ctx context.Context, name string) (essence.KeyValueCollection, error)
- func (s *Store) KeyValueCollections(ctx context.Context) map[string]essence.KeyValueCollection
- func (s *Store) ListCollection(ctx context.Context, name string) (essence.ListCollection, error)
- func (s *Store) ListCollections(ctx context.Context) map[string]essence.ListCollection
- func (s *Store) RemoveCollection(ctx context.Context, col essence.Collection)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructSchemaKeyForCollection ¶
func ConstructSchemaKeyForCollection(s *Store, col essence.Collection) string
func DeconstructSchemaKey ¶
parse out and return the important values in a schema-key
func LongToShort ¶
Types ¶
type CollectionMap ¶
type CollectionMap struct {
// contains filtered or unexported fields
}
type KeyValueCollection ¶
type KeyValueCollection struct {
// contains filtered or unexported fields
}
a KeyValueCollection is a collection that can operate on key-value pairs
func (*KeyValueCollection) All ¶
func (kv *KeyValueCollection) All(ctx context.Context) map[string][]byte
func (*KeyValueCollection) Destroy ¶
func (kv *KeyValueCollection) Destroy(ctx context.Context) error
func (*KeyValueCollection) Keyspace ¶
func (c *KeyValueCollection) Keyspace() string
a fully-qualified namespace for the collection
func (*KeyValueCollection) Kind ¶
func (c *KeyValueCollection) Kind() string
Kind is always "kv" for this kind of [Collection]
func (*KeyValueCollection) Name ¶
func (c *KeyValueCollection) Name() string
Name is a namespace, or a table name
type ListCollection ¶
type ListCollection struct {
// contains filtered or unexported fields
}
func (*ListCollection) Keyspace ¶
func (c *ListCollection) Keyspace() string
a fully-qualified namespace for the collection
func (*ListCollection) Kind ¶
func (c *ListCollection) Kind() string
Kind is always "kv" for this kind of [Collection]
func (*ListCollection) Name ¶
func (c *ListCollection) Name() string
Name is a namespace, or a table name
type Store ¶
type Store struct { Namespace string // contains filtered or unexported fields }
a Store is a store of persistant data, structured into Collections. Store implements essence.Store.
func (*Store) CollectionExists ¶
func (*Store) KeyValueCollection ¶
func (*Store) KeyValueCollections ¶
func (*Store) ListCollection ¶
func (*Store) ListCollections ¶
func (*Store) RemoveCollection ¶
func (s *Store) RemoveCollection(ctx context.Context, col essence.Collection)
remove the collection from the Store's Collection map
Click to show internal directories.
Click to hide internal directories.