package trie

import "github.com/dgraph-io/badger/v2/trie"

Index

Types

type Trie

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

Trie datastructure.

func NewTrie

func NewTrie() *Trie

NewTrie returns Trie.

func (*Trie) Add

func (t *Trie) Add(prefix []byte, id uint64)

Add adds the id in the trie for the given prefix path.

func (*Trie) Delete

func (t *Trie) Delete(index []byte, id uint64)

Delete will delete the id if the id exist in the given index path.

func (*Trie) Get

func (t *Trie) Get(key []byte) map[uint64]struct{}

Get returns prefix matched ids for the given key.

Source Files

trie.go

Version
v2.2007.4 (latest)
Published
Aug 25, 2021
Platform
linux/amd64
Last checked
1 week ago

Tools for package owners.