Documentation
¶
Index ¶
- Constants
- type Client
- type ClientOption
- type ClientOptions
- type DefaultTool
- func (d *DefaultTool) BatchFlush(ctx context.Context, c []fmt.Stringer) error
- func (d *DefaultTool) BatchGet(ctx context.Context, c []fmt.Stringer) ([]contract.CacheHit, error)
- func (d *DefaultTool) BatchSet(ctx context.Context, e map[fmt.Stringer]contract.CacheHit) error
- func (d *DefaultTool) CacheID(ctx context.Context, id string) (contract.CacheID, error)
- func (d *DefaultTool) DecodeHit(ctx context.Context, c contract.CacheHit, dst any) error
- func (d *DefaultTool) Exists(ctx context.Context, c fmt.Stringer) (bool, error)
- func (d *DefaultTool) Flush(ctx context.Context, c fmt.Stringer) error
- func (d *DefaultTool) FlushAll(ctx context.Context) error
- func (d *DefaultTool) Get(ctx context.Context, c fmt.Stringer) (*contract.CacheHit, error)
- func (d *DefaultTool) HitFromValue(ctx context.Context, v any) (*contract.CacheHit, error)
- func (d *DefaultTool) Set(ctx context.Context, c fmt.Stringer, v contract.CacheHit) error
- type Dependencies
- type Tool
Constants ¶
View Source
const (
WCard = "*"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
contract.CacheOperator
}
func NewClient ¶
func NewClient(d Dependencies, opts ClientOptions) (Client, error)
type ClientOption ¶ added in v0.1.14
type ClientOption = contract.Opt[ClientOptions]
func WithTimeout ¶ added in v0.1.14
func WithTimeout(x time.Duration) ClientOption
type ClientOptions ¶ added in v0.1.14
func ApplyClientOptions ¶ added in v0.1.14
func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions
type DefaultTool ¶ added in v0.1.11
func NewTool ¶
func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool
func (*DefaultTool) BatchFlush ¶ added in v0.1.11
BatchFlush removes multiple cache entries by their keys or matching patterns.
func (*DefaultTool) BatchGet ¶ added in v0.1.11
BatchGet retrieves multiple cache values for the given keys.
func (*DefaultTool) BatchSet ¶ added in v0.1.11
BatchSet stores multiple cache values for the given keys.
func (*DefaultTool) DecodeHit ¶ added in v0.1.11
DecodeHit decodes a cached value into the given destination type.
func (*DefaultTool) Flush ¶ added in v0.1.11
Flush removes a single cache entry by key or matching pattern.
func (*DefaultTool) FlushAll ¶ added in v0.1.11
func (d *DefaultTool) FlushAll(ctx context.Context) error
FlushAll clears the entire cache.
func (*DefaultTool) HitFromValue ¶ added in v0.1.11
HitFromValue converts a value into a cache entry.
type Dependencies ¶ added in v0.1.8
Click to show internal directories.
Click to hide internal directories.