cache

package
v0.0.0-...-8b65dd2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCALCACHE_TTL = 1800 //unit:s
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiCache

type DiCache struct {
	RedisCache *redis.Manager
	Cache      *freecache.Cache
	Size       int
	TTL        int
}

func NewDiCache

func NewDiCache(redisCache *redis.Manager, size int, ttl int) *DiCache

func (*DiCache) Get

func (this *DiCache) Get(ctx context.Context, key string) (string, error)

func (*DiCache) GetMust

func (this *DiCache) GetMust(ctx context.Context, key, defaultValue string) string

func (*DiCache) MGet

func (this *DiCache) MGet(ctx context.Context, keys []string) (map[string]string, error)

Jump to

Keyboard shortcuts

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