Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { Encode(w io.Writer, i interface{}) error Decode(r io.Reader) (interface{}, error) }
Codec serializes and deserializes entities.
type KV ¶
type KV interface { Put(key []byte, val []byte) error Has(key []byte) (bool, error) Get(key []byte) ([]byte, error) Del(key []byte) error }
KV represents a common wrapper around a key-value database.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a store to store entities by unique ID.
func New ¶
New creates a new store for entities, using the given codec to encode them, the key-value store to save the data and the prefix to add to the key for differentiation with other entities in the same store.
Click to show internal directories.
Click to hide internal directories.