Documentation ¶
Index ¶
- Variables
- func Run(c cnfg.Config) error
- func String(t Searchable) string
- func TestCOW(c cnfg.Config) error
- func TestMerge(cnfg.Config) error
- func ToGviz(g gviz.Graph, file, title string) error
- type Database
- type Joiner
- type KeyValue
- type SearchFunc
- type Searchable
- type StringDatabase
- type StringKeyValue
- type Trie
- func (t *Trie) Copy() *Trie
- func (t *Trie) Delete(key []byte) (Database, error)
- func (t *Trie) Edges() (out []gviz.Edge)
- func (t *Trie) Get(key []byte) ([]byte, error)
- func (t *Trie) Hash() ([]byte, error)
- func (t *Trie) IsClean() bool
- func (t *Trie) MarkDirty()
- func (t *Trie) Nodes() (out []gviz.Node)
- func (t *Trie) Search(f SearchFunc) (*KeyValue, error)
- func (t *Trie) Set(key, value []byte) (Database, error)
- func (t *Trie) String() string
- func (t *Trie) ToGviz(file, title string) error
- type Visualizable
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyKey = errors.New("empty key")
View Source
var NotFound = errors.New("key not found")
returned or wrapped to indicate key not found
Functions ¶
func String ¶
func String(t Searchable) string
Types ¶
type Database ¶
type Database interface { Set([]byte, []byte) (Database, error) Get([]byte) ([]byte, error) Delete([]byte) (Database, error) Hash() ([]byte, error) Searchable Visualizable }
copy-on-write database
type SearchFunc ¶
type Searchable ¶
type Searchable interface { // error indicates not found or worse, else keyvalue is non-nil Search(SearchFunc) (*KeyValue, error) }
type StringDatabase ¶
type StringDatabase interface { Set(string, string) (StringDatabase, error) Get(string) (string, error) Delete(string) (StringDatabase, error) Hash() ([]byte, error) Search(func(kv *StringKeyValue) bool) (*StringKeyValue, error) Visualizable }
func NewStrings ¶
func NewStrings(db Database) StringDatabase
type StringKeyValue ¶
type StringKeyValue struct {
Key, Value string
}
type Trie ¶
type Trie struct { *KeyValue Merkle []byte Next [256]*Trie Count *big.Int // number of kv pairs in this and all descendants }
type Visualizable ¶
Click to show internal directories.
Click to hide internal directories.