Documentation ¶
Index ¶
Constants ¶
View Source
const ( NodeTypeValue = uint8(2) NodeTypeEdge = uint8(4) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes []byte
Bytes represents byte slice
func (Bytes) LastSharedIndex ¶
LastSharedIndex computes the last prefix shared indexed
type KeyProvider ¶
type KeyProvider interface {
Key() interface{}
}
KeyProvider represents entity key provider
type Node ¶
type Node struct { Type uint8 Prefix []byte ValueIndex uint32 Nodes // contains filtered or unexported fields }
Node represents a node
type Nodes ¶
type Nodes []*Node
Nodes represents node slice
type OnMatch ¶
onMatch represents matching input handler, return value instruct trie to continue search
type Trie ¶
type Trie interface { Put(key []byte, value interface{}) error Merge(key []byte, value interface{}, merger Merger) error Get(key []byte) (interface{}, bool) Has(key []byte) bool //Walk all tries value nodes. Walk(handler Visitor) //MatchPrefix matches input prefix, ie. input: dev.domain.com, would match with trie keys like: dev, dev.domain MatchPrefix(input []byte, handler OnMatch) bool //MatchAll matches input with any occurrences of tries keys. MatchAll(input []byte, handler OnMatch) bool UseType(vType reflect.Type) Decode(reader io.Reader) error Encode(writer io.Writer) error ValueCount() int }
Click to show internal directories.
Click to hide internal directories.