Documentation
¶
Index ¶
- func WithDefaultDuration[K comparable, V any](duration time.Duration) trcache.RootOption
- func WithDeleteCustomParams[K comparable, V any](customParams interface{}) trcache.DeleteOption
- func WithDeleteRedisDelFunc[K comparable, V any](redisDelFunc RedisDelFunc[K, V]) trcache.DeleteOption
- func WithDeleteRedisDelFuncFunc[K comparable, V any](redisDelFunc RedisDelFuncFunc[K, V]) trcache.DeleteOption
- func WithGetCustomParams[K comparable, V any](customParams interface{}) trcache.GetOption
- func WithGetRedisGetFunc[K comparable, V any](redisGetFunc RedisGetFunc[K, V]) trcache.GetOption
- func WithGetRedisGetFuncFunc[K comparable, V any](redisGetFunc RedisGetFuncFunc[K, V]) trcache.GetOption
- func WithKeyCodec[K comparable, V any](keyCodec trcache.KeyCodec[K]) trcache.RootOption
- func WithRedisDelFunc[K comparable, V any](redisDelFunc RedisDelFunc[K, V]) trcache.RootOption
- func WithRedisGetFunc[K comparable, V any](redisGetFunc RedisGetFunc[K, V]) trcache.RootOption
- func WithRedisSetFunc[K comparable, V any](redisSetFunc RedisSetFunc[K, V]) trcache.RootOption
- func WithSetCustomParams[K comparable, V any](customParams interface{}) trcache.SetOption
- func WithSetRedisSetFunc[K comparable, V any](redisSetFunc RedisSetFunc[K, V]) trcache.SetOption
- func WithSetRedisSetFuncFunc[K comparable, V any](redisSetFuncFunc RedisSetFuncFunc[K, V]) trcache.SetOption
- func WithValidator[K comparable, V any](validator trcache.Validator[V]) trcache.RootOption
- func WithValueCodec[K comparable, V any](valueCodec trcache.Codec[V]) trcache.RootOption
- type Cache
- func (c *Cache[K, V]) Delete(ctx context.Context, key K, options ...trcache.DeleteOption) error
- func (c *Cache[K, V]) Get(ctx context.Context, key K, options ...trcache.GetOption) (V, error)
- func (c *Cache[K, V]) Handle() *redis.Client
- func (c *Cache[K, V]) Name() string
- func (c *Cache[K, V]) Set(ctx context.Context, key K, value V, options ...trcache.SetOption) error
- type DefaultRedisDelFunc
- type DefaultRedisGetFunc
- type DefaultRedisSetFunc
- type RedisDelFunc
- type RedisDelFuncFunc
- type RedisGetFunc
- type RedisGetFuncFunc
- type RedisSetFunc
- type RedisSetFuncFunc
- type RefreshCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDefaultDuration ¶
func WithDefaultDuration[K comparable, V any](duration time.Duration) trcache.RootOption
func WithDeleteCustomParams ¶
func WithDeleteCustomParams[K comparable, V any](customParams interface{}) trcache.DeleteOption
func WithDeleteRedisDelFunc ¶
func WithDeleteRedisDelFunc[K comparable, V any](redisDelFunc RedisDelFunc[K, V]) trcache.DeleteOption
func WithDeleteRedisDelFuncFunc ¶
func WithDeleteRedisDelFuncFunc[K comparable, V any](redisDelFunc RedisDelFuncFunc[K, V]) trcache.DeleteOption
func WithGetCustomParams ¶
func WithGetCustomParams[K comparable, V any](customParams interface{}) trcache.GetOption
func WithGetRedisGetFunc ¶
func WithGetRedisGetFunc[K comparable, V any](redisGetFunc RedisGetFunc[K, V]) trcache.GetOption
func WithGetRedisGetFuncFunc ¶
func WithGetRedisGetFuncFunc[K comparable, V any](redisGetFunc RedisGetFuncFunc[K, V]) trcache.GetOption
func WithKeyCodec ¶
func WithKeyCodec[K comparable, V any](keyCodec trcache.KeyCodec[K]) trcache.RootOption
func WithRedisDelFunc ¶
func WithRedisDelFunc[K comparable, V any](redisDelFunc RedisDelFunc[K, V]) trcache.RootOption
func WithRedisGetFunc ¶
func WithRedisGetFunc[K comparable, V any](redisGetFunc RedisGetFunc[K, V]) trcache.RootOption
func WithRedisSetFunc ¶
func WithRedisSetFunc[K comparable, V any](redisSetFunc RedisSetFunc[K, V]) trcache.RootOption
func WithSetCustomParams ¶
func WithSetCustomParams[K comparable, V any](customParams interface{}) trcache.SetOption
func WithSetRedisSetFunc ¶
func WithSetRedisSetFunc[K comparable, V any](redisSetFunc RedisSetFunc[K, V]) trcache.SetOption
func WithSetRedisSetFuncFunc ¶
func WithSetRedisSetFuncFunc[K comparable, V any](redisSetFuncFunc RedisSetFuncFunc[K, V]) trcache.SetOption
func WithValidator ¶
func WithValidator[K comparable, V any](validator trcache.Validator[V]) trcache.RootOption
func WithValueCodec ¶
func WithValueCodec[K comparable, V any](valueCodec trcache.Codec[V]) trcache.RootOption
Types ¶
type Cache ¶
type Cache[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any](redis *redis.Client, options ...trcache.RootOption) (*Cache[K, V], error)
type DefaultRedisDelFunc ¶
type DefaultRedisDelFunc[K comparable, V any] struct { }
type DefaultRedisGetFunc ¶
type DefaultRedisGetFunc[K comparable, V any] struct { }
type DefaultRedisSetFunc ¶
type DefaultRedisSetFunc[K comparable, V any] struct { }
type RedisDelFunc ¶
type RedisDelFuncFunc ¶
type RedisGetFunc ¶
type RedisGetFuncFunc ¶
type RedisSetFunc ¶
type RedisSetFuncFunc ¶
type RefreshCache ¶ added in v0.5.0
type RefreshCache[K comparable, V any, RD any] struct { *Cache[K, V] // contains filtered or unexported fields }
func NewRefresh ¶
func NewRefresh[K comparable, V any, RD any](redis *redis.Client, options ...trcache.RootOption) (*RefreshCache[K, V, RD], error)
func (*RefreshCache[K, V, RD]) GetOrRefresh ¶ added in v0.5.0
func (c *RefreshCache[K, V, RD]) GetOrRefresh(ctx context.Context, key K, options ...trcache.RefreshOption) (V, error)
Click to show internal directories.
Click to hide internal directories.