Documentation
¶
Index ¶
- type CacheAside
- func (rca *CacheAside) Client() rueidis.Client
- func (rca *CacheAside) Del(ctx context.Context, key string) error
- func (rca *CacheAside) DelMulti(ctx context.Context, keys ...string) error
- func (rca *CacheAside) Get(ctx context.Context, ttl time.Duration, key string, ...) (string, error)
- func (rca *CacheAside) GetMulti(ctx context.Context, ttl time.Duration, keys []string, ...) (map[string]string, error)
- type CacheAsideOption
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheAside ¶
type CacheAside struct {
// contains filtered or unexported fields
}
func NewRedCacheAside ¶
func NewRedCacheAside(clientOption rueidis.ClientOption, caOption CacheAsideOption) (*CacheAside, error)
func (*CacheAside) Client ¶
func (rca *CacheAside) Client() rueidis.Client
func (*CacheAside) DelMulti ¶
func (rca *CacheAside) DelMulti(ctx context.Context, keys ...string) error
type CacheAsideOption ¶
type CacheAsideOption struct {
// LockTTL is the maximum time a lock can be held, and also the timeout for waiting
// on locks when handling lost Redis invalidation messages. Defaults to 10 seconds.
LockTTL time.Duration
ClientBuilder func(option rueidis.ClientOption) (rueidis.Client, error)
// Logger for logging non-fatal errors. Defaults to slog.Default().
Logger Logger
}
Click to show internal directories.
Click to hide internal directories.