cache

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNode = "caches"
)

Variables

View Source
var Nil = errors.New("Nil")

Functions

func Deregister

func Deregister(name string)

Deregister 清理配置适配器

func NewBuilder

func NewBuilder() container.StandardBuilder

func Register

func Register(resolver cacheResover)

RegisterCache 注册配置文件适配器

Types

type ICache

type ICache interface {
	Name() string
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key string, val interface{}, expire int) error
	Del(ctx context.Context, key string) error
	HashGet(ctx context.Context, hk, key string) (string, error)
	HashSet(ctx context.Context, hk, key string, val string) (bool, error)
	HashDel(ctx context.Context, hk, key string) error
	Increase(ctx context.Context, key string) (int64, error)
	Decrease(ctx context.Context, key string) (int64, error)
	Expire(ctx context.Context, key string, expire int) error
	Exists(ctx context.Context, key string) (bool, error)
	GetImpl() interface{}
}

type StandardCache

type StandardCache interface {
	GetCache(name ...string) (q ICache)
}

StandardCache cache

func NewStandardCache

func NewStandardCache(c container.Container) StandardCache

NewStandardCache 创建cache

Jump to

Keyboard shortcuts

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