cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(key string) error

func Get

func Get(key string) (string, error)

func GetClient

func GetClient() redis.UniversalClient

func GetConn

func GetConn() redis.Cmdable

func HGet

func HGet(key, childKey string) (string, error)

func HGetAll

func HGetAll(key string) (map[string]string, error)

func HMGetAll

func HMGetAll(key string, fields ...string) ([]string, error)

func HSet

func HSet(key string, value map[string]interface{}) error

func HSetEx

func HSetEx(key string, value map[string]interface{}, seconds uint) error

func NewCache

func NewCache(opt *CacheOption) *cache.Cache

func Set

func Set(key string, value interface{}) error

func SetEx

func SetEx(key string, value interface{}, expiration uint) error

func Stop

func Stop()

Types

type CacheOption

type CacheOption struct {
	StatsEnabled   bool
	Marshal        cache.MarshalFunc
	Unmarshal      cache.UnmarshalFunc
	LocalCache     bool
	LocalCacheSize int
	LocalCacheTTL  time.Duration
}

Jump to

Keyboard shortcuts

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