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.
Click to show internal directories.
Click to hide internal directories.