Versions in this module Expand all Collapse all v0 v0.1.0 Jul 13, 2026 Changes in this version + const MinKeySize + var ErrBuilderClosed = sherr.ErrBuilderClosed + var ErrChecksumFailed = sherr.ErrChecksumFailed + var ErrCorruptedIndex = sherr.ErrCorruptedIndex + var ErrDuplicateKey = sherr.ErrDuplicateKey + var ErrFingerprintTooLarge = sherr.ErrFingerprintTooLarge + var ErrIndexClosed = sherr.ErrIndexClosed + var ErrIndistinguishableHashes = sherr.ErrIndistinguishableHashes + var ErrInvalidMagic = sherr.ErrInvalidMagic + var ErrInvalidVersion = sherr.ErrInvalidVersion + var ErrKeyCountMismatch = sherr.ErrKeyCountMismatch + var ErrKeyTooLong = sherr.ErrKeyTooLong + var ErrKeyTooShort = sherr.ErrKeyTooShort + var ErrNoPayload = sherr.ErrNoPayload + var ErrNotFound = sherr.ErrNotFound + var ErrPayloadOverflow = sherr.ErrPayloadOverflow + var ErrPayloadTooLarge = sherr.ErrPayloadTooLarge + var ErrSplitBucketSeedSearchFailed = sherr.ErrSplitBucketSeedSearchFailed + var ErrTooManyKeys = sherr.ErrTooManyKeys + var ErrTruncatedFile = sherr.ErrTruncatedFile + var ErrUnsortedInput = sherr.ErrUnsortedInput + func PreHash(key []byte) []byte + func PreHashInPlace(dst []byte, key []byte) + type Algorithm uint16 + const AlgoBijection + const AlgoPTRHash + func (a Algorithm) String() string + type BuildOption func(*buildConfig) + func WithAlgorithm(algo Algorithm) BuildOption + func WithFingerprint(sizeBytes int) BuildOption + func WithGlobalSeed(seed uint64) BuildOption + func WithMetadata(data []byte) BuildOption + func WithPayload(sizeBytes int) BuildOption + func WithWorkers(n int) BuildOption + type Index struct + func Open(path string) (*Index, error) + func OpenBytes(data []byte) (*Index, error) + func OpenFile(f *os.File) (*Index, error) + func (idx *Index) Close() error + func (idx *Index) NumBlocks() uint32 + func (idx *Index) NumKeys() uint64 + func (idx *Index) PayloadSize() int + func (idx *Index) QueryRank(key []byte) (uint64, error) + func (idx *Index) Stats() *Stats + func (idx *Index) UserMetadata() []byte + func (idx *Index) Verify() error + func (idx *Index) WithPayload() (*PayloadIndex, error) + type PayloadIndex struct + func OpenPayload(path string) (*PayloadIndex, error) + func OpenPayloadBytes(data []byte) (*PayloadIndex, error) + func OpenPayloadFile(f *os.File) (*PayloadIndex, error) + func (pi *PayloadIndex) QueryPayload(key []byte) (rank uint64, payload uint64, err error) + type SortedBuilder struct + func NewSortedBuilder(ctx context.Context, output string, totalKeys uint64, opts ...BuildOption) (*SortedBuilder, error) + func (sb *SortedBuilder) AddKey(key []byte, payload uint64) error + func (sb *SortedBuilder) Close() error + func (sb *SortedBuilder) Finish() error + type Stats struct + Algorithm Algorithm + BitsPerKey float64 + FileSize int64 + FingerprintSize int + NumBlocks uint32 + NumKeys uint64 + OverheadBPK float64 + PayloadSize int + func GetStats(path string) (*Stats, error) + type UnsortedBuilder struct + func NewUnsortedBuilder(ctx context.Context, output string, totalKeys uint64, tempDir string, ...) (*UnsortedBuilder, error) + func (ub *UnsortedBuilder) AddKey(key []byte, payload uint64) error + func (ub *UnsortedBuilder) AddKeys(numWriters int, ...) error + func (ub *UnsortedBuilder) Close() error + func (ub *UnsortedBuilder) Finish() error