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