trie

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K_LIMIT  = 0x0F
	CHILDREN = 0x100
)

Variables

This section is empty.

Functions

func New

func New() *tree

Types

type FoldFunc

type FoldFunc (func([]byte, []byte, interface{}) interface{})

type TreeNode

type TreeNode struct {
	Value    []byte
	Children map[uint8]*TreeNode
}

func (*TreeNode) Fold

func (t *TreeNode) Fold(p []byte, f FoldFunc, b interface{}) interface{}

func (*TreeNode) Get

func (t *TreeNode) Get(k []byte) []byte

func (*TreeNode) Set

func (t *TreeNode) Set(k, v []byte) error

type Trie

type Trie interface {
	Get([]byte) []byte
	Set([]byte, []byte) error
	Fold(FoldFunc, interface{}) interface{}
}

Jump to

Keyboard shortcuts

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