linearhash

package
v0.0.0-...-932458b Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinearHash

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

LinearHash implements on-disk hashing based indexing using Linear Hashing algorithm.

func Open

func Open(indexFile string, opts *Options) (*LinearHash, error)

Open opens the file as linear-hash indexing file and returns the indexer instance. If 'opts' is nil, uses default options.

func (*LinearHash) Close

func (idx *LinearHash) Close() error

Close flushes any pending writes and frees the file descriptor.

func (*LinearHash) Del

func (idx *LinearHash) Del(key []byte) (uint64, error)

Del removes the entry for the given key from the hash table and returns the removed entry.

func (*LinearHash) Get

func (idx *LinearHash) Get(key []byte) (uint64, error)

Get finds the index entry for given key in the hash table and returns. If not entry found, returns ErrKeyNotFound.

func (*LinearHash) Put

func (idx *LinearHash) Put(key []byte, val uint64) error

Put inserts the indexing entry into the hash table.

func (*LinearHash) String

func (idx *LinearHash) String() string

type Options

type Options struct {
	ReadOnly bool
	FileMode os.FileMode
}

Options can be provided to Open() to configure initialization.

Jump to

Keyboard shortcuts

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