cache

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Local = NewLocalCache()

Functions

This section is empty.

Types

type LocalCache

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

func (*LocalCache) Close

func (c *LocalCache) Close()

func (*LocalCache) Del

func (c *LocalCache) Del(key string) error

func (*LocalCache) Get

func (c *LocalCache) Get(key string, result interface{}) error

Get get cache data

func (*LocalCache) GetValue

func (c *LocalCache) GetValue(key string) (value any, err error)

GetValue get cache data

func (*LocalCache) IsExists

func (c *LocalCache) IsExists(key string) bool

func (*LocalCache) Set

func (c *LocalCache) Set(key string, data interface{}, expire time.Duration) error

func (*LocalCache) TTL

func (c *LocalCache) TTL(key string) (expire int64, err error)

type LocalCacheIer

type LocalCacheIer interface {
	IsExists(key string) bool
	Set(key string, data interface{}, expire time.Duration) error
	Get(key string, result interface{}) error
	Del(key string) error
	Close()
}

LocalCacheIer local cache interface

func NewLocalCache

func NewLocalCache() LocalCacheIer

type Value

type Value struct {
	Data   any
	Expire int64
}

Jump to

Keyboard shortcuts

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