cache

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(cache Cache) error

func Delete

func Delete(cache Cache, key string) error

func Get

func Get[T any](cache Cache, key string) (T, error)

func GetAll

func GetAll(cache Cache) (map[string]string, error)

func GetMulti

func GetMulti(cache Cache, keys []string) (map[string]string, error)

func Set

func Set(cache Cache, key string, value any, expireSec int64) error

Types

type Cache

type Cache interface {
	Set(key string, value string, expireSec int64) error
	Get(key string) (string, error)
	GetMulti(keys []string) (map[string]string, error)
	GetAll() (map[string]string, error)
	Delete(key string) error
	Clear() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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