cache

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("key not found or expired")

Functions

func BloomCacheKeyCheck added in v0.0.6

func BloomCacheKeyCheck(key string) bool

func BloomFilterAdd added in v0.0.6

func BloomFilterAdd(key string)

func InitBoomFilter added in v0.0.6

func InitBoomFilter(n uint, fp float64)

InitBoomFilter 初始化布隆过滤器

func IsErrKeyNotFound added in v0.0.6

func IsErrKeyNotFound(err error) bool

func Marshal added in v0.0.6

func Marshal(data interface{}) ([]byte, error)

func SetTranscoderFunc added in v0.0.6

func SetTranscoderFunc(marshaller Marshaller, unMarshaller UnMarshaller)

func UnMarshal added in v0.0.6

func UnMarshal(data []byte, receiver interface{}) error

Types

type AbstractCache

type AbstractCache interface {
	Get(string) ([]byte, error)
	GetWithUnmarshal(string, interface{}) error

	Set(string, []byte, ...int) error
	SetWithMarshal(string, interface{}, ...int) error

	Delete(string) error
	Exists(string) bool

	Remember(string, interface{}, RememberCallback, ...int) error

	GetProvider() interface{}
}

type Marshaller added in v0.0.6

type Marshaller func(interface{}) ([]byte, error)

type RememberCallback added in v0.0.6

type RememberCallback func() (interface{}, error)

type UnMarshaller added in v0.0.6

type UnMarshaller func([]byte, interface{}) error

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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