drt

package module
v0.0.0-...-40fd383 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

README

drt

drt is a read-only, disk-based radix trie.

Documentation

Overview

Package drt implements a read-only, on-disk radix tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

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

Trie is a read-only, on-disk radix tree.

func Open

func Open(path string) (*Trie, error)

Open opens the disk-based radix trie at the given path.

func (*Trie) Close

func (t *Trie) Close() error

Close closes the raidx trie.

func (*Trie) Has

func (t *Trie) Has(key []byte) bool

Has returns true if the Trie contains the given key.

type Writer

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

Writer will create a read-only, on-disk radix trie.

func Create

func Create(path string) (*Writer, error)

Create creates a radix trie at the given path. If one already exists it will be overwritten. The Writer must be closed for the radix tree to be written.

func (*Writer) Close

func (w *Writer) Close() error

Close flushes the Trie to disk.

func (*Writer) Insert

func (w *Writer) Insert(key string)

Insert inserts the given key into the radix trie.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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