Versions in this module Expand all Collapse all v0 v0.1.22 Jul 26, 2024 Changes in this version + var ErrorCacheEmpty = fmt.Errorf("cache empty") + var ErrorDoEmpty = fmt.Errorf("do empty") + func DoIdempotent(ctx context.Context, store *redis.Redis, key string, v any, ...) (bool, error) + type Idempotent struct + func NewIdempotent(store *redis.Redis, key string) *Idempotent + func (i *Idempotent) Lock(ctx context.Context, seconds int) (bool, error) + func (i *Idempotent) SetCacheValue(ctx context.Context, v any, expired int) error + func (i *Idempotent) TryGetCacheValue(ctx context.Context, v any) (cached bool, err error) + func (i *Idempotent) Unlock(ctx context.Context) error