cache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyExpired  = merror.Error("the key is expired")
	ErrKeyNotExist = merror.Error("the key isn't exist")
)

Functions

func RegisterNewCacheImpl

func RegisterNewCacheImpl(name string, impl Instance)

Types

type Cache

type Cache interface {
	GetClient() interface{}
	Get(ctx context.Context, key string) (interface{}, error)
	GetMulti(ctx context.Context, keys []string) ([]interface{}, error)
	Put(ctx context.Context, key string, val interface{}, timeout time.Duration) error
	Delete(ctx context.Context, key string) error
	Start(config string) error
}

func NewCache

func NewCache(implName, config string) (adapter Cache, err error)

type Instance

type Instance func() Cache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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