echoturnstile

package
v0.0.0-...-197cbbb Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EchoIdempotencyKeyExtractor

func EchoIdempotencyKeyExtractor(c echo.Context) (string, error)

func EchoRemoteIPExtractor

func EchoRemoteIPExtractor(c echo.Context) (string, error)

func NewMiddleware

func NewMiddleware(secret string) echo.MiddlewareFunc

func NewMiddlewareWithConfig

func NewMiddlewareWithConfig(secret string, cfg Config) echo.MiddlewareFunc

Types

type Config

type Config struct {
	Skipper                        echomiddleware.Skipper
	TurnstileVerifier              turnstile.Verifier
	TurnstileResponseExtractorFunc TurnstileResponseExtractorFunc
	RemoteIPExtractorFunc          RemoteIPExtractorFunc
	IdempotencyKeyExtractorFunc    IdempotencyKeyExtractorFunc
}

type IdempotencyKeyExtractorFunc

type IdempotencyKeyExtractorFunc func(c echo.Context) (string, error)

type RemoteIPExtractorFunc

type RemoteIPExtractorFunc func(c echo.Context) (string, error)

func CloudFlareRequestHeaderRemoteIPExtractor

func CloudFlareRequestHeaderRemoteIPExtractor() RemoteIPExtractorFunc

type TurnstileResponseExtractorFunc

type TurnstileResponseExtractorFunc func(c echo.Context) (string, error)

func RequestHeaderTurnstileResponseExtractorFunc

func RequestHeaderTurnstileResponseExtractorFunc() TurnstileResponseExtractorFunc

func RequestHeaderTurnstileResponseExtractorFuncWithHeaderName

func RequestHeaderTurnstileResponseExtractorFuncWithHeaderName(headerName string) TurnstileResponseExtractorFunc

Jump to

Keyboard shortcuts

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