hTrie

package
v0.0.0-...-3511098 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Pointer  string
	Weight   uint32
	Children []*Node
	Hash     [16]byte
}

func (*Node) Delete

func (n *Node) Delete(s Shard, prefix string) error

func (*Node) Insert

func (n *Node) Insert(s Shard, prefix string) error

func (*Node) Print

func (n *Node) Print()

func (*Node) Update

func (n *Node) Update(s Shard, prefix string) error

func (*Node) UpdateHash

func (n *Node) UpdateHash() error

func (*Node) Verify

func (n *Node) Verify() error

type Shard

type Shard struct {
	Pointer string
	Weight  uint32
}

func (*Shard) GetCoords

func (s *Shard) GetCoords(prefix string) []string

type Trie

type Trie struct {
	Root   *Node
	Prefix string
	Ops    []Update
}

func NewTrie

func NewTrie(shards []Shard, prefix string) (*Trie, error)

func (*Trie) Insert

func (t *Trie) Insert(s Shard) error

func (*Trie) Print

func (t *Trie) Print()

func (*Trie) Verify

func (t *Trie) Verify() error

type Update

type Update struct {
	Type    string
	Pointer string
	Weight  uint32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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