memory

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Name = `memory`

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.0.5

type Cache interface {
	cache.Cache
	Range(Handler)
}

func New

func New(opts ...interface{}) Cache

type Handler added in v0.0.2

type Handler func(k string, i Item) bool

Handler 回调方法

type Item added in v0.0.2

type Item interface {
	Value() interface{}
	Expired() bool
}

type Option

type Option func(b *barrel)

func WithCallback

func WithCallback(fun Handler) Option

WithCallback 自定义超时回调方法

func WithCheckDur

func WithCheckDur(dur time.Duration) Option

WithCheckDur 自定义超时检查间隔

func WithShardNum

func WithShardNum(num int) Option

WithShardNum 自定义分片数

func WithTimer added in v0.0.2

func WithTimer(fun Handler) Option

WithTimer 自定义定时检查方法 fun 将会轮询每一个元素,返回false时将会立即触发超时回调

Jump to

Keyboard shortcuts

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