cache

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AdapterMemory = "memory"
	AdapterRedis  = "redis"
)

Variables

View Source
var (
	ErrorAdapterInstanceNotExist = errors.New("cache adapter instance not exist")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Exists(key string) bool
	Get(key string, data any) error
	Set(key string, data any, expiration time.Duration) error
	Destroy(key string) error

	MustGet(key string, data any)
	MustSet(key string, data any, expiration time.Duration)
	MustDestroy(key string)
}

func New

func New(ctx context.Context, mem *memory.Client, redis *redis.Client) Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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