radix

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package radix provides an implementation of a specialized radix tree. The implementation draws heavy inspiration from https://github.com/armon/go-radix.

Index

Constants

View Source
const WildcardElem = -1

WildcardElem is a sentinel value that subsumes all others.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tree

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

A Tree is radix tree whose edges are each labeled by a byte, and whose conceptual leaf nodes each contain a set of ints. The zero value of a Tree is an empty tree.

func (*Tree) Contains

func (t *Tree) Contains(k string, v int) bool

Contains reports whether t contains key-value pair (k,v).

func (*Tree) Elems added in v0.2.0

func (t *Tree) Elems() []string

Elems returns a slice containing textual representations of t's elements.

func (*Tree) Insert

func (t *Tree) Insert(keyPattern string, v int)

Insert inserts v in the tree according to keyPattern. A leading * byte (0x2a) denotes a wildcard for any non-empty byte sequence. A non-leading * has no special meaning and is treated as any other byte. Sentinel value -1 represents a wildcard value that subsumes all others.

Jump to

Keyboard shortcuts

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