libfile

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0, CC0-1.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const ReasonableNoCrashSize = 1000000000 // Giga byte

Variables

This section is empty.

Functions

This section is empty.

Types

type BloomFilter

type BloomFilter struct {
	BlockHash  [32]byte
	P2wshCount uint64
	Payload    []byte
}

func (*BloomFilter) KeyHash

func (f *BloomFilter) KeyHash() uint64

func (*BloomFilter) PackKeyAndSize

func (f *BloomFilter) PackKeyAndSize() [48]byte

func (*BloomFilter) PayloadSize

func (f *BloomFilter) PayloadSize() uint64

func (*BloomFilter) Serialize

func (f *BloomFilter) Serialize() string

func (*BloomFilter) SerializedSize

func (f *BloomFilter) SerializedSize() uint64

type FileSet

type FileSet map[*FilterDbFile]struct{}

func OpenManyEach

func OpenManyEach(fileNamesWriteable, fileNamesUnwriteable []string, eacher func(*BloomFilter)) (fset FileSet, err error)

func OpenManyEachMaxPayload added in v0.0.4

func OpenManyEachMaxPayload(fileNamesWriteable, fileNamesUnwriteable []string, maxPayloadEacher uint64, eacher func(*BloomFilter)) (fset FileSet, err error)

func (*FileSet) Add

func (fset *FileSet) Add(filter *BloomFilter) (err error)

func (*FileSet) Get

func (fset *FileSet) Get(blockHash [32]byte, p2wshCount, minPayload, maxPayload uint64) (filter *BloomFilter)

func (*FileSet) GetSmallest added in v0.0.9

func (fset *FileSet) GetSmallest(blockHash [32]byte, p2wshCount, minPayload, maxPayload uint64) (filter *BloomFilter)

type FilterDbFile

type FilterDbFile struct {
	Writeable bool
	Name      string

	Table libcombindex.Table
	// contains filtered or unexported fields
}

func Open

func Open(fileName string, writeable bool) (f *FilterDbFile, err error)

func OpenEach

func OpenEach(fileName string, writeable bool, eacher func(*BloomFilter)) (f *FilterDbFile, err error)

func OpenEachMaxPayload added in v0.0.4

func OpenEachMaxPayload(fileName string, writeable bool, maxPayloadEacher uint64, eacher func(*BloomFilter)) (f *FilterDbFile, err error)

func OpenMaxPayload added in v0.0.4

func OpenMaxPayload(fileName string, writeable bool, maxPayloadEacher uint64) (f *FilterDbFile, err error)

func (*FilterDbFile) Add

func (ffile *FilterDbFile) Add(filter *BloomFilter) (err error)

func (*FilterDbFile) Get

func (f *FilterDbFile) Get(blockHash [32]byte, p2wshCount, minPayload, maxPayload uint64) (filter *BloomFilter)

Jump to

Keyboard shortcuts

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