cache

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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 Cache added in v0.22.0

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

func NewMemoryCache

func NewMemoryCache() Cache

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) Cache

NewRedisCache create a redis backed cache.

Jump to

Keyboard shortcuts

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