Documentation
¶
Index ¶
- Variables
- func GetJSON[T any](ctx context.Context, rdb redis.UniversalClient, key string) (T, error)
- func Key(parts ...string) string
- func RememberJSON[T any](ctx context.Context, rdb redis.UniversalClient, key string, ttl time.Duration, ...) (T, error)
- func SetJSON(ctx context.Context, rdb redis.UniversalClient, key string, value any, ...) error
- type Client
- type Lock
- type Option
- type Redis
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheMiss = errors.New("cache miss")
Functions ¶
func RememberJSON ¶
Types ¶
type Client ¶
type Client interface{ redis.UniversalClient }
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
func LockWithWait ¶
type Redis ¶
type Redis struct {
Client redis.UniversalClient
// contains filtered or unexported fields
}
type RedisConfig ¶
type RedisConfig struct {
Mode string `json:"mode" yaml:"mode"`
Addr string `json:"addr" yaml:"addr"`
Addrs []string `json:"addrs" yaml:"addrs"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
DB int `json:"db" yaml:"db"`
DialTimeout string `json:"dial_timeout" yaml:"dial_timeout"`
ReadTimeout string `json:"read_timeout" yaml:"read_timeout"`
WriteTimeout string `json:"write_timeout" yaml:"write_timeout"`
PoolSize int `json:"pool_size" yaml:"pool_size"`
}
Click to show internal directories.
Click to hide internal directories.