Documentation
¶
Overview ¶
Package cache provides Redis/Valkey persistence for idempotent operations.
Index ¶
- type Client
- type ConsistencyError
- type Options
- type Store
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Get(ctx context.Context, key string) (idempotency.Record, error)
- func (s *Store) Put(ctx context.Context, record idempotency.Record, now time.Time) error
- func (s *Store) Update(ctx context.Context, record idempotency.Record) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Get(context.Context, string) *redis.StringCmd
SetArgs(context.Context, string, any, redis.SetArgs) *redis.StatusCmd
Del(context.Context, ...string) *redis.IntCmd
Eval(context.Context, string, []string, ...any) *redis.Cmd
}
Client is implemented by go-redis standalone, Sentinel and cluster clients. The caller configures credentials, TLS, deadlines and retries, and owns Close.
type ConsistencyError ¶
type ConsistencyError struct{ Err error }
func (*ConsistencyError) Error ¶
func (e *ConsistencyError) Error() string
func (*ConsistencyError) Unwrap ¶
func (e *ConsistencyError) Unwrap() error
type Options ¶
type Options struct {
StatusAttribute, ExpiryAttribute, InProgressExpiryAttribute string
DataAttribute, ValidationAttribute string
Now func() time.Time
// OmitValidationOnSuccess reproduces the pinned TypeScript cache writer's
// omission. Leave false to retain validation when replaying completed records.
OmitValidationOnSuccess bool
}
Click to show internal directories.
Click to hide internal directories.