cache

package
v0.16.7 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generic

type Generic interface {
	Get(ctx context.Context, key string, value interface{}) (bool, error)
	Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
	Del(ctx context.Context, keys ...string) error
}

func NewMemoryCache

func NewMemoryCache() Generic

NewMemoryCache return an in-memory cache. This cache backend should be used to cache limited-sized entries like user group permission rule.

func NewRedisCache

func NewRedisCache(cli *redis.Client) Generic

NewRedisCache create a redis backed cache.

Jump to

Keyboard shortcuts

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