Versions in this module Expand all Collapse all v1 v1.1.0 Nov 7, 2026 v1.0.0 Nov 7, 2026 Changes in this version + const HeaderKey + const HeaderReplayed + var ErrInFlight = errors.New("idempotency: the original request is still running") + var ErrNotFound = errors.New("idempotency: no record") + func New(opt Options) fiber.Handler + type GormRecord struct + Body []byte + Completed bool + ContentType string + CreatedAt time.Time + ExpiresAt time.Time + Fingerprint string + Key string + Status int + func (GormRecord) TableName() string + type GormStore struct + func NewGormStore(db *gorm.DB) *GormStore + func (s *GormStore) Abandon(ctx context.Context, key string) error + func (s *GormStore) Begin(ctx context.Context, key, fingerprint string, ttl time.Duration) (*Record, error) + func (s *GormStore) Complete(ctx context.Context, key string, rec Record, ttl time.Duration) error + func (s *GormStore) Sweep(ctx context.Context) (int64, error) + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (s *MemoryStore) Abandon(_ context.Context, key string) error + func (s *MemoryStore) Begin(_ context.Context, key, fingerprint string, ttl time.Duration) (*Record, error) + func (s *MemoryStore) Complete(_ context.Context, key string, rec Record, ttl time.Duration) error + type Options struct + Methods []string + Require bool + Skip func(c fiber.Ctx) bool + Store Store + TTL time.Duration + type Record struct + Body []byte + ContentType string + CreatedAt time.Time + Fingerprint string + Key string + Status int + type Store interface + Abandon func(ctx context.Context, key string) error + Begin func(ctx context.Context, key, fingerprint string, ttl time.Duration) (*Record, error) + Complete func(ctx context.Context, key string, rec Record, ttl time.Duration) error