gcs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func U64FromHex

func U64FromHex(src []byte) uint64

Types

type Builder

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

func NewBuilder

func NewBuilder(in *os.File, out io.Writer, probability uint64, indexGranularity uint64) *Builder

NewBuilder builder for a new GCS file database.

probability is the False positive rate for queries, 1-in-p. indexGranularity is the entries per index point (16 bytes each).

func (*Builder) Process

func (b *Builder) Process(skipWait bool) error

Process creates the gcs file using the inputs in the builder Concurrent file read inspired by https://marcellanz.com/post/file-read-challenge/

type Reader

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

func NewReader

func NewReader(fileName string) *Reader

func (*Reader) Exists

func (r *Reader) Exists(target uint64) (bool, error)

func (*Reader) Initialize

func (r *Reader) Initialize() error

Initialize only loads the database index into memory. This does not load the whole file in RAM.

Jump to

Keyboard shortcuts

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