cachex

package
v0.0.0-...-2e5bba8 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNil = errors.New("cache: nil")

ErrNil reply returned by cache when key does not exist.

Functions

This section is empty.

Types

type MultiLevelCache

type MultiLevelCache struct {
}

type SingleFlightCache

type SingleFlightCache struct {
	Store Store
	// contains filtered or unexported fields
}

func (*SingleFlightCache) Delete

func (store *SingleFlightCache) Delete(ctx context.Context, key string) error

func (*SingleFlightCache) Get

func (store *SingleFlightCache) Get(ctx context.Context, key string) (any, error)

func (*SingleFlightCache) Set

func (store *SingleFlightCache) Set(ctx context.Context, key string, val any) error

type Store

type Store interface {
	Get(ctx context.Context, key string) (any, error)
	Set(ctx context.Context, key string, val any) error
	Delete(ctx context.Context, key string) error
}

Store 定义接口

func ShardedCache

func ShardedCache(stores []Store) Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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