trie

package module
v0.0.0-...-ea5769a Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 5 Imported by: 0

README

go-trie

A Go (golang) radix trie

Documentation

Index

Constants

View Source
const (
	R2   radix = 2
	R4   radix = 4
	R16  radix = 16
	R256 radix = 256
)

Variables

This section is empty.

Functions

func MinInt

func MinInt(a, b int) int

func Uint32ToBytes

func Uint32ToBytes(buf []byte, num uint32) []byte

Types

type Item

type Item = generic.Type

type ItemTrie

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

func NewItemTrie

func NewItemTrie() *ItemTrie

func (*ItemTrie) Del

func (t *ItemTrie) Del(key []byte)

func (*ItemTrie) Get

func (t *ItemTrie) Get(key []byte) *node

func (*ItemTrie) Put

func (t *ItemTrie) Put(key []byte, value Item)

type Prefix

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

func NewPrefix

func NewPrefix(rdx radix, key []byte) Prefix

func (*Prefix) Get

func (p *Prefix) Get(idx int) byte

func (*Prefix) Len

func (p *Prefix) Len() int

func (Prefix) Slice

func (p Prefix) Slice(args ...int) Prefix

Use receiver type of Prefix instead of *Prefix so that we get a simple, shallow copy of p.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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