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 ¶
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
Click to show internal directories.
Click to hide internal directories.