multilevel

package
v0.0.0-...-0c20f4c Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CdbSizeThreshold = 1 << 30

CdbSizeThreshold is 1Gb

Variables

This section is empty.

Functions

func Compact

func Compact(path string, threshold int) error

Compact compacts path directory, if number of cdb files greater than threshold

func MergeCdbs

func MergeCdbs(newfn string, filenames ...string) error

MergeCdbs merges the cdbs, dumping filenames to newfn

Types

type Multi

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

Multi is a type for the opened cdbs

func Open

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

Open opens the path

func (*Multi) Close

func (m *Multi) Close()

Close closes the Multi

func (*Multi) Data

func (m *Multi) Data(key []byte) ([]byte, error)

Data returns the data for the key

type Question

type Question struct {
	Key    []byte
	Answch chan Result
}

Question is the key to query for and the channel to answer on

type Result

type Result struct {
	Data []byte
	Err  error
}

Result is an answer can be nice data or io.EOF if not found (or other error)

Jump to

Keyboard shortcuts

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