Documentation ¶
Index ¶
- func BasicAuthOptionalMiddleware(next http.Handler) http.Handler
- func CloudflareMiddleware(log zerolog.Logger) func(next http.Handler) http.Handler
- func ContextWithBasicAuth(ctx context.Context, basicAuth *BasicAuth) context.Context
- func ContextWithUserAgent(ctx context.Context, userAgent string) context.Context
- func CorsMiddleware(allowedOrigins []string) func(next http.Handler) http.Handler
- func IpContextMiddleware(next http.Handler) http.Handler
- func IpForContext(ctx context.Context) net.IP
- func LoggerMiddleware(logger zerolog.Logger, cloudflare bool, optSkipPaths ...[]string) func(next http.Handler) http.Handler
- func NewRouter(logger zerolog.Logger, serviceName string, cloudflare bool) *chi.Mux
- func RequestIDHeaderMiddleware(next http.Handler) http.Handler
- func RequireCloudflareMiddleware(log zerolog.Logger) func(next http.Handler) http.Handler
- func ServerWithAutoCert(domain string, httpServer *http.Server, httpsServer *http.Server)
- func UserAgentFromContext(ctx context.Context) string
- func UserAgentMiddleware(next http.Handler) http.Handler
- type BasicAuth
- type CloudflareContext
- type Daemon
- type DaemonServer
- type FcgiServer
- type Getter
- type GetterConfig
- type ReCaptcha
- func (r ReCaptcha) PublicSettings() ReCaptchaPublicSettings
- func (r ReCaptcha) ReCaptchaV2Verify(ctx context.Context, token string) (*ReCaptchaV2Response, error)
- func (r ReCaptcha) ReCaptchaV3Verify(ctx context.Context, token string) (*ReCaptchaV3Response, error)
- func (r ReCaptcha) VerifyReCaptchaTokensFromContext(ctx context.Context, action string, tokens ReCaptchaTokens) error
- type ReCaptchaPublicSettings
- type ReCaptchaTokens
- type ReCaptchaV2Response
- type ReCaptchaV3Response
- type Server
- type Turnstile
- type TurnstileVerifyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthOptionalMiddleware ¶ added in v0.14.7
func CloudflareMiddleware ¶ added in v0.12.0
func ContextWithBasicAuth ¶ added in v0.14.7
func ContextWithUserAgent ¶ added in v0.14.7
func CorsMiddleware ¶
func LoggerMiddleware ¶ added in v0.12.0
func LoggerMiddleware(logger zerolog.Logger, cloudflare bool, optSkipPaths ...[]string) func(next http.Handler) http.Handler
LoggerMiddleware is a copy of httplog.RequestLogger, but with Cloudflare header support.
func RequireCloudflareMiddleware ¶ added in v0.12.0
func ServerWithAutoCert ¶
func UserAgentFromContext ¶ added in v0.14.7
Types ¶
type BasicAuth ¶ added in v0.14.7
func BasicAuthFromContext ¶ added in v0.14.7
type CloudflareContext ¶ added in v0.12.0
func CloudflareFromContext ¶ added in v0.12.0
func CloudflareFromContext(ctx context.Context) CloudflareContext
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
type DaemonServer ¶ added in v0.0.13
type FcgiServer ¶ added in v0.0.13
type FcgiServer struct { Router http.Handler SocketPath string // Dev only, should not be used in production. GlobalRwx bool }
func NewFcgiServerFromEnv ¶ added in v0.0.13
func NewFcgiServerFromEnv(router http.Handler) *FcgiServer
type Getter ¶ added in v0.12.0
type Getter struct {
// contains filtered or unexported fields
}
Getter is a helper for retrieving & caching an ETagged http response.
func NewGetter ¶ added in v0.12.0
func NewGetter(config GetterConfig) *Getter
type GetterConfig ¶ added in v0.12.0
type ReCaptcha ¶ added in v0.1.0
type ReCaptcha struct { Log zerolog.Logger SecretKeyV2 string SiteKeyV2 string SecretKeyV3 string SiteKeyV3 string MinScoreV3 float32 }
func NewReCaptchaFromEnv ¶ added in v0.1.0
func (ReCaptcha) PublicSettings ¶ added in v0.1.0
func (r ReCaptcha) PublicSettings() ReCaptchaPublicSettings
func (ReCaptcha) ReCaptchaV2Verify ¶ added in v0.1.0
func (ReCaptcha) ReCaptchaV3Verify ¶ added in v0.1.0
func (ReCaptcha) VerifyReCaptchaTokensFromContext ¶ added in v0.1.0
type ReCaptchaPublicSettings ¶ added in v0.1.0
type ReCaptchaTokens ¶ added in v0.1.0
type ReCaptchaV2Response ¶ added in v0.1.0
type ReCaptchaV3Response ¶ added in v0.1.0
type Server ¶
type Turnstile ¶ added in v0.15.7
type Turnstile struct {
// contains filtered or unexported fields
}
func NewTurnstileFromEnv ¶ added in v0.15.7
Click to show internal directories.
Click to hide internal directories.