hybrid

package
v0.0.103 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 8 Imported by: 85 modules, 124 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDiskOptions = Options{
	Type:            Disk,
	DBType:          LevelDB,
	Cleanup:         true,
	RemoveOlderThan: 24 * time.Hour * 2,
}
View Source
var DefaultHybridOptions = Options{
	Type:                 Hybrid,
	DBType:               PogrebDB,
	MemoryExpirationTime: time.Duration(5) * time.Minute,
	JanitorTime:          time.Duration(1) * time.Minute,
}
View Source
var DefaultMemoryOptions = Options{
	Type: Memory,
}
View Source
var DefaultOptions = Options{
	Type:                 Memory,
	MemoryExpirationTime: time.Duration(5) * time.Minute,
	JanitorTime:          time.Duration(1) * time.Minute,
}

Functions

This section is empty.

Types

type DBType added in v0.0.2

type DBType int
const (
	LevelDB DBType = iota
	PogrebDB
	BBoltDB
	BuntDB
)

type HybridMap

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

func New

func New(options Options) (*HybridMap, error)

func (*HybridMap) Close

func (hm *HybridMap) Close() error

func (*HybridMap) Del

func (hm *HybridMap) Del(key string) error

func (*HybridMap) Get

func (hm *HybridMap) Get(k string) ([]byte, bool)

func (*HybridMap) Scan

func (hm *HybridMap) Scan(f func([]byte, []byte) error)

func (*HybridMap) Set

func (hm *HybridMap) Set(k string, v []byte) error

func (*HybridMap) Size

func (hm *HybridMap) Size() int64

func (*HybridMap) TuneMemory

func (hm *HybridMap) TuneMemory()

type MapType

type MapType int
const (
	Memory MapType = iota
	Disk
	Hybrid
)

type Options

type Options struct {
	MemoryExpirationTime time.Duration
	DiskExpirationTime   time.Duration
	JanitorTime          time.Duration
	Type                 MapType
	DBType               DBType
	MemoryGuardForceDisk bool
	MemoryGuard          bool
	MaxMemorySize        int
	MemoryGuardTime      time.Duration
	Path                 string
	Cleanup              bool
	Name                 string
	// Remove temporary hmap in the temporary folder older than duration
	RemoveOlderThan time.Duration
}

Jump to

Keyboard shortcuts

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