trie

package
v0.0.0-...-3633571 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

func (*Iterator) Key

func (i *Iterator) Key() []byte

Key returns the current key

func (*Iterator) Next

func (i *Iterator) Next() bool

Next moves the iterator to the next key value pair in the trie

func (*Iterator) Value

func (i *Iterator) Value() interface{}

Value returns the current value

type Trie

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

func New

func New() *Trie

func (*Trie) Delete

func (t *Trie) Delete(key []byte) bool

Delete deletes the specified key from the trie.

func (*Trie) Get

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

Get returns the value associated with the specified key or nil.

func (*Trie) Iterator

func (t *Trie) Iterator() *Iterator

Iterator returns an iterator that can be used to traverse the trie in sorted order. The iterator starts before the first key value pair, so Next() should be called before Key() and Value()

func (*Trie) Len

func (t *Trie) Len() int

Len returns the number of key value pairs in the trie.

func (*Trie) Set

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

Set inserts or replaces the specified key and value.

Jump to

Keyboard shortcuts

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