Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdempotencyRequest ¶
type IdempotencyRequest struct {
Key string `db:"idempotency_key"`
Status Status `db:"status"`
ResponseCode sql.NullInt64 `db:"response_code"`
ResponseHeaders []byte `db:"response_headers"`
ResponseBody []byte `db:"response_body"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt sql.NullTime `db:"updated_at"`
}
IdempotencyRequest represents a stored request in the database.
type IdempotencyStore ¶
type IdempotencyStore interface {
io.Closer
Get(ctx context.Context, key string) (*IdempotencyRequest, error)
Create(ctx context.Context, key string) error
Update(ctx context.Context, key string, code int, headers, body []byte) error
Error(ctx context.Context, key string, code int, headers, body []byte) error
Cleanup(ctx context.Context) error
DB() *sqlx.DB
}
func NewIdempotencyStore ¶
func NewIdempotencyStore(db *sqlx.DB, cleanUpThresholdInDays int) (IdempotencyStore, error)
NewIdempotencyStore creates a new store for idempotency checks.
Click to show internal directories.
Click to hide internal directories.