Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct {
OnHit func(ctx context.Context, key string)
OnMiss func(ctx context.Context, key string)
OnSet func(ctx context.Context, key string, ttl time.Duration)
OnDelete func(ctx context.Context, key string)
OnError func(ctx context.Context, op string, key string, err error)
}
Hooks defines cache lifecycle callbacks.
type RedisOptions ¶
type RedisOptions struct {
DisableDefaults bool
Network string
Address string
Username string
Password string
DB int
Prefix string
DefaultTTL time.Duration
DialTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
}
RedisOptions configures a Redis cache store.
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore stores cache entries in Redis.
func NewRedisStore ¶
func NewRedisStore(options RedisOptions) *RedisStore
NewRedisStore creates a Redis-backed cache store.
func (*RedisStore) Delete ¶
func (s *RedisStore) Delete(ctx context.Context, key string) error
Delete removes a cache entry.
Click to show internal directories.
Click to hide internal directories.