persist

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

Persist

Persist is a library for adding data persistence to the native Go type system.

Documentation

Index

Constants

View Source
const (
	// DefaultSize is the default size of the set
	DefaultSize = 100

	// DefaultLoadFactor is the default load factor of the set
	DefaultLoadFactor = 0.75

	// GrowthFactorSmall is the growth factor for small sets
	GrowthFactorSmall = 20

	// GrowthFactorLarge is the growth factor for large sets
	GrowthFactorLarge = 1.2

	// SmallSetSize is the size at which the set is considered small
	SmallSetSize = 10000

	// LargeSetSize is the size at which the set is considered large
	LargeSetSize = 100000000
)

Variables

View Source
var HashBytes = xxhash.Checksum64

HashBytes is an alias for xxhash.Checksum64.

HashString is an alias for xxhash.ChecksumString64.

Functions

func DefaultInterpolate

func DefaultInterpolate() func(uint64) uint64

func EnsureDir

func EnsureDir(path string) error

EnsureDir checks if a directory exists at the given path. If the path exists and is a directory, it returns nil. If the path exists but is not a directory, it returns an error. If the path does not exist, it creates the directory and returns nil.

func HashU64

func HashU64(key uint64) (hash uint64)

HashU64 is an implementation of a Murmur3 algorithm, manually unwrapped.

func NewHashU64

func NewHashU64() func(uint64) uint64

NewHashU64 returns a new instance of a Murmur3 function. The returned function is not thread safe.

func NewInterpolateFunc

func NewInterpolateFunc(sizeS, sizeL uint64, resizeS, resizeL float64) func(uint64) uint64

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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