cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STAGE_ONE = 1
	STAGE_TWO = 2
)

Variables

This section is empty.

Functions

func KeyToHash

func KeyToHash(key interface{}) (uint64, uint64)

func MemHash

func MemHash(data []byte) uint64

func MemHashString

func MemHashString(str string) uint64

func NewCmRow

func NewCmRow(numCounters int64) cmRow

func NewWinLRU

func NewWinLRU(size int, data map[uint64]*list.Element) *winLRU

Types

type BloomFilter

type BloomFilter []byte

func (BloomFilter) Allow

func (b BloomFilter) Allow(keyHash uint32) bool

func (BloomFilter) AllowKey

func (b BloomFilter) AllowKey(key []byte) bool

func (BloomFilter) Insert

func (b BloomFilter) Insert(keyHash uint32) bool

type Cache

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

func NewCache

func NewCache(numEntries int) *Cache

func (*Cache) Del

func (c *Cache) Del(key interface{}) (interface{}, bool)

func (*Cache) Get

func (c *Cache) Get(key interface{}) (interface{}, bool)

func (*Cache) Set

func (c *Cache) Set(key, val interface{}) bool

func (*Cache) String

func (c *Cache) String() string

Jump to

Keyboard shortcuts

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