Documentation ¶
Index ¶
- Variables
- func DoIdempotent(ctx context.Context, store *redis.Redis, key string, v any, ...) (bool, error)
- type 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
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorDoEmpty = fmt.Errorf("do empty") ErrorCacheEmpty = fmt.Errorf("cache empty") )
Functions ¶
Types ¶
type Idempotent ¶
type Idempotent struct {
// contains filtered or unexported fields
}
func NewIdempotent ¶
func NewIdempotent(store *redis.Redis, key string) *Idempotent
func (*Idempotent) SetCacheValue ¶
func (*Idempotent) TryGetCacheValue ¶
Click to show internal directories.
Click to hide internal directories.