idempotency

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderName = "Idempotency-Key"
	FormField  = "idempotency_token"

	CodeKeyRequired = "idempotency_key_required"
	CodeDuplicate   = "duplicate_submission"
	CodeServerError = "server_error"
)

Variables

This section is empty.

Functions

func Token

func Token(r *http.Request) string

Types

type Guard

type Guard struct {
	Claim            func(scope, key string, window time.Duration) (bool, error)
	Release          func(scope, key string)
	Actor            func(r *http.Request) string
	Refuse           func(w http.ResponseWriter, r *http.Request, status int, code string)
	ErrorFlashQueued func(h http.Header) bool
}

func (*Guard) Require

func (g *Guard) Require(scope string, next http.HandlerFunc) http.HandlerFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL