Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Delete(key string) Store(key string, value string) Range(f func(key, value string) bool) }
func NewRedisCache ¶
func NewRedisCache(cache GlobalCache, prefix consts.RedisKey) Cache
type GlobalCache ¶
type GlobalCache interface { HDel(ctx context.Context, prefix string, keys ...string) error HSet(ctx context.Context, prefix string, values ...[]byte) error HGet(ctx context.Context, prefix string, keys string) ([]byte, error) HGetAll(ctx context.Context, prefix string) (map[string][]byte, error) Get(ctx context.Context, key string) ([]byte, error) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error Del(ctx context.Context, keys ...string) error SetNX(ctx context.Context, key string, value []byte, ttl time.Duration) bool Exists(ctx context.Context, keys ...string) int64 Close() error }
func NewNutsDbCache ¶
func NewNutsDbCache(opts ...NutsDbOption) (GlobalCache, error)
func NewRedisGlobalCache ¶
func NewRedisGlobalCache(client *redis.Client) GlobalCache
type NutsDbOption ¶
type NutsDbOption func(*nutsDbCache)
func WithBucket ¶
func WithBucket(bucket string) NutsDbOption
func WithDB ¶
func WithDB(db *nutsdb.DB) NutsDbOption
Click to show internal directories.
Click to hide internal directories.