Documentation
¶
Index ¶
- func MustInitTieredCache(redisAddress string)
- type RedisCache
- func (cache *RedisCache) Get(ctx context.Context, key string, returnValue interface{}) (interface{}, error)
- func (cache *RedisCache) GetBool(ctx context.Context, key string) (bool, error)
- func (cache *RedisCache) GetString(ctx context.Context, key string) (string, error)
- func (cache *RedisCache) GetUint64(ctx context.Context, key string) (uint64, error)
- func (cache *RedisCache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (cache *RedisCache) SetBool(ctx context.Context, key string, value bool, expiration time.Duration) error
- func (cache *RedisCache) SetString(ctx context.Context, key, value string, expiration time.Duration) error
- func (cache *RedisCache) SetUint64(ctx context.Context, key string, value uint64, expiration time.Duration) error
- type RemoteCache
- type TieredCacher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustInitTieredCache ¶
func MustInitTieredCache(redisAddress string)
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func InitRedisCache ¶
func InitRedisCache(ctx context.Context, redisAddress string) (*RedisCache, error)
func (*RedisCache) Get ¶
func (cache *RedisCache) Get(ctx context.Context, key string, returnValue interface{}) (interface{}, error)
type RemoteCache ¶
type RemoteCache interface {
Set(ctx context.Context, key string, value any, expiration time.Duration) error
SetString(ctx context.Context, key, value string, expiration time.Duration) error
SetUint64(ctx context.Context, key string, value uint64, expiration time.Duration) error
SetBool(ctx context.Context, key string, value bool, expiration time.Duration) error
Get(ctx context.Context, key string, returnValue any) (any, error)
GetString(ctx context.Context, key string) (string, error)
GetUint64(ctx context.Context, key string) (uint64, error)
GetBool(ctx context.Context, key string) (bool, error)
}
type TieredCacher ¶ added in v1.59.0
type TieredCacher interface {
Set(key string, value interface{}, expiration time.Duration) error
SetString(key string, value string, expiration time.Duration) error
SetUint64(key string, value uint64, expiration time.Duration) error
SetBool(key string, value bool, expiration time.Duration) error
GetStringWithLocalTimeout(key string, localExpiration time.Duration) (string, error)
GetUint64WithLocalTimeout(key string, localExpiration time.Duration) (uint64, error)
GetBoolWithLocalTimeout(key string, localExpiration time.Duration) (bool, error)
GetWithLocalTimeout(key string, localExpiration time.Duration, returnValue interface{}) (interface{}, error)
}
var TieredCache TieredCacher
Click to show internal directories.
Click to hide internal directories.