Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MagicHeader identifies ELLIO pre-computed trie format MagicHeader = "ELLIOTRIE" // FormatVersion of the trie format FormatVersion uint16 = 2 )
Variables ¶
View Source
var ( // ErrInvalidMagic indicates the file doesn't have the ELLIOTRIE header ErrInvalidMagic = errors.New("invalid magic header, not an ELLIOTRIE format file") // ErrUnsupportedVersion indicates an unsupported format version ErrUnsupportedVersion = errors.New("unsupported ELLIOTRIE format version") )
Functions ¶
This section is empty.
Types ¶
type SerializedNode ¶
type SerializedNode struct {
LeftChild uint32 // Index of left child, 0xFFFFFFFF if none
RightChild uint32 // Index of right child, 0xFFFFFFFF if none
Flags uint8 // Bit 0: isEnd, Bits 1-7: depth
}
SerializedNode represents a node in the serialized trie format
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
Trie is a binary trie for fast IP prefix lookups
func BulkLoad ¶
BulkLoad creates a new trie from a list of prefixes ASSUMES: Input data is already sorted (IPv4 first, then IPv6, both in ascending order)
func LoadBinaryTrie ¶
LoadBinaryTrie loads a pre-computed trie from ELLIOTRIE format
func LoadPrecomputedTrie ¶
LoadPrecomputedTrie loads a pre-computed trie structure from binary format
func (*Trie) ContainsUnsafe ¶
ContainsUnsafe performs a lockless lookup - ONLY use when trie is read-only
Click to show internal directories.
Click to hide internal directories.