essence

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection interface {
	Kind() string
	Name() string
	Store() Store
	Keyspace() string
}

a Collection is like a table. A discrete and namespaced area for data of a particular Kind

type KeyValueCollection

type KeyValueCollection interface {
	Collection
	Get(context.Context, string) ([]byte, error)
	Set(context.Context, string, []byte) error
	Keys(context.Context) []string
	All(context.Context) map[string][]byte
	Destroy(context.Context) error
}

a KeyValueCollection has methods allowing it to behave as a key-value store

type ListCollection

type ListCollection interface {
	Collection
	Pop(context.Context) ([]byte, error)
	Push(context.Context, []byte) error
	Shift(context.Context) ([]byte, error)
	Unshift(context.Context, []byte) error
	All(context.Context) [][]byte
	Size(context.Context) int
	Head(context.Context) ([]byte, error)
	Tail(context.Context) ([]byte, error)
	Destroy(context.Context) error
}

a ListCollection has methods allowing it to be operated on as a list

type Store

type Store interface {
	KeyValueCollection(context.Context, string) (KeyValueCollection, error)
	ListCollection(context.Context, string) (ListCollection, error)
	RemoveCollection(context.Context, Collection)
	CollectionExists(context.Context, string, string) bool
	KeyValueCollections(context.Context) map[string]KeyValueCollection
	ListCollections(context.Context) map[string]ListCollection
	Destroy(context.Context) error
}

a store is a logical namespace that contains collections, which are themselves logical namespaces

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL