cache

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

*

  • 缓存 *
  • @create 2021-7-15
  • @author deatil

func New

func New(driver interfaces.Driver, conf ...Config) *Cache

创建

func (*Cache) Decrement

func (this *Cache) Decrement(key string, value ...int64) error

减去一

func (*Cache) Flush

func (this *Cache) Flush() (bool, error)

清空

func (*Cache) Forever

func (this *Cache) Forever(key string, value any) error

永久设置

func (*Cache) Forget

func (this *Cache) Forget(key string) (bool, error)

删除

func (*Cache) Get

func (this *Cache) Get(key string) (any, error)

获取

func (*Cache) GetConfig

func (this *Cache) GetConfig(name string) goch.Goch

获取配置

func (*Cache) GetDriver

func (this *Cache) GetDriver() interfaces.Driver

获取驱动

func (*Cache) GetPrefix

func (this *Cache) GetPrefix() string

获取前缀

func (*Cache) Has

func (this *Cache) Has(key string) bool

获取

func (*Cache) Increment

func (this *Cache) Increment(key string, value ...int64) error

增加一

func (*Cache) Pull

func (this *Cache) Pull(key string) (any, error)

获取后删除

func (*Cache) Put

func (this *Cache) Put(key string, value any, ttl any) error

设置

func (*Cache) WithConfig

func (this *Cache) WithConfig(config Config) *Cache

设置配置

func (*Cache) WithDriver

func (this *Cache) WithDriver(driver interfaces.Driver) *Cache

设置驱动

func (*Cache) WithPrefix

func (this *Cache) WithPrefix(prefix string) *Cache

设置前缀

type Config

type Config = map[string]any

配置

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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