Documentation
¶
Index ¶
- func NewRedisClient(ctx context.Context, retryOpts helper.RetryOptions, d RedisClientDependencies, ...) (contract.RedisClient, error)
- type Blackbox
- type Client
- type ClientOption
- type ClientOptions
- type DefaultTool
- func (d *DefaultTool) BatchFlush(ctx context.Context, keys []fmt.Stringer) error
- func (d *DefaultTool) BatchGet(ctx context.Context, keys []fmt.Stringer) ([]contract.CacheHit, error)
- func (d *DefaultTool) BatchSet(ctx context.Context, entries map[fmt.Stringer]contract.CacheHit) error
- func (d *DefaultTool) Close(ctx context.Context) error
- func (d *DefaultTool) Exists(ctx context.Context, key fmt.Stringer) (bool, error)
- func (d *DefaultTool) Flush(ctx context.Context, pattern fmt.Stringer) error
- func (d *DefaultTool) FlushAll(ctx context.Context) error
- func (d *DefaultTool) Get(ctx context.Context, key fmt.Stringer) (*contract.CacheHit, error)
- func (d *DefaultTool) Set(ctx context.Context, key fmt.Stringer, value contract.CacheHit) error
- type Dependencies
- type Loaded
- type RedisClientDependencies
- type RedisClientOptions
- type Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisClient ¶
func NewRedisClient(ctx context.Context, retryOpts helper.RetryOptions, d RedisClientDependencies, opts RedisClientOptions) (contract.RedisClient, error)
Types ¶
type Client ¶
type Client interface { Blackbox contract.RedisOperator }
func NewClient ¶
func NewClient(d Dependencies, opts ClientOptions) (Client, error)
func NewNoopClient ¶ added in v0.1.83
func NewNoopClient() Client
type ClientOption ¶
type ClientOption func(*ClientOptions)
func WithBatchSize ¶
func WithBatchSize(x int) ClientOption
func WithExpiresAfter ¶
func WithExpiresAfter(x time.Duration) ClientOption
type ClientOptions ¶
func ApplyClientOptions ¶
func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions
type DefaultTool ¶ added in v0.1.11
func NewTool ¶ added in v0.1.10
func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool
func (*DefaultTool) BatchFlush ¶ added in v0.1.11
BatchFlush removes multiple specific keys from Redis.
func (*DefaultTool) BatchGet ¶ added in v0.1.11
func (d *DefaultTool) BatchGet(ctx context.Context, keys []fmt.Stringer) ([]contract.CacheHit, error)
BatchGet retrieves multiple values from Redis by keys.
func (*DefaultTool) BatchSet ¶ added in v0.1.11
func (d *DefaultTool) BatchSet(ctx context.Context, entries map[fmt.Stringer]contract.CacheHit) error
BatchSet stores multiple key-value pairs in Redis.
func (*DefaultTool) Close ¶ added in v0.1.13
func (d *DefaultTool) Close(ctx context.Context) error
Close closes the underlying client.
func (*DefaultTool) Flush ¶ added in v0.1.11
Flush removes all keys matching the given pattern from Redis.
func (*DefaultTool) FlushAll ¶ added in v0.1.11
func (d *DefaultTool) FlushAll(ctx context.Context) error
FlushAll removes all entries from Redis.
type Dependencies ¶ added in v0.1.8
type Dependencies struct {
C contract.RedisClient
}
type RedisClientDependencies ¶ added in v0.1.14
type RedisClientDependencies struct { C contract.CertGenerator F contract.FSysFileReader }
type RedisClientOptions ¶
type Tool ¶ added in v0.1.245
type Tool interface { contract.RedisOperator }
Click to show internal directories.
Click to hide internal directories.