index

package
v0.0.0-...-91ac70b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateKey = errors.New("duplicate keys aren't supported")

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	N      int64
	Values []uint32
}

type Built

type Built struct {
	Table     []byte
	Level0Len uint64
	Level1Len uint64
}

func Build

func Build(it datafile.Iter) (Built, error)

Build builds a inMemoryBuilder from keys using the "Hash, displace, and compress" algorithm described in http://cmph.sourceforge.net/papers/esa09.pdf.

type Table

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

Table is an index into a datafile, backed by an mmap'd file.

func NewTable

func NewTable(tbl Built) (*Table, error)

NewTable returns a new `*index.Table` based on the on-disk table at `path`.

func (*Table) MaybeLookup

func (t *Table) MaybeLookup(b []byte) datafile.PackedOffset

MaybeLookup searches for b in t and returns its potential index.

func (*Table) MaybeLookupString

func (t *Table) MaybeLookupString(s string) datafile.PackedOffset

MaybeLookupString searches for b in t and returns its potential index.

Jump to

Keyboard shortcuts

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