trie

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FreeListSize = uint64(0)
)

Constant of trie

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context is the write context of trie

func NewContext

func NewContext() *Context

NewContext returns new context

type FreeList

type FreeList struct {
	// contains filtered or unexported fields
}

FreeList is a free list of trie node All trie that fork from the same trie share the same free list

func NewFreeList

func NewFreeList() *FreeList

NewFreeList create a default FreeList

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node is node of trie

type Trie

type Trie struct {
	// contains filtered or unexported fields
}

Trie is the mvcc trie

func New

func New() *Trie

New returns new trie

func (*Trie) All

func (t *Trie) All(prefix []byte) []interface{}

All returns the list of node prefixed with prefix

func (*Trie) Fork

func (t *Trie) Fork() interface{}

Fork will fork the trie thread safe between all forks of the trie

func (*Trie) Free

func (t *Trie) Free()

Free will free the memory of trie

func (*Trie) Get

func (t *Trie) Get(key []byte) interface{}

Get returns the value of specify key

func (*Trie) Put

func (t *Trie) Put(key []byte, value interface{})

Put will insert the key-value pair

Jump to

Keyboard shortcuts

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