recaptcha

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recaptchas

type Recaptchas struct {
	Next  httpserver.Handler
	Rules []Rule
}

func (Recaptchas) ServeHTTP

func (h Recaptchas) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

type RecordedAndDecodeIfRequired added in v0.0.2

type RecordedAndDecodeIfRequired interface {
	RecordedAndDecodeIfRequired() []byte
}

type Rule

type Rule interface {
	GetPath() string
	GetMethod() string
	GetAction() string
	GetSiteKey() string
	Validate(r *http.Request) bool
}

type V2Result

type V2Result struct {
	Success  bool   `json:"success"`
	Hostname string `json:"hostname"`
}

type V2Rule

type V2Rule struct {
	Secret  string
	Method  string
	Path    string
	SiteKey string
}

func (V2Rule) GetAction added in v0.0.2

func (rule V2Rule) GetAction() string

func (V2Rule) GetMethod added in v0.0.2

func (rule V2Rule) GetMethod() string

func (V2Rule) GetPath added in v0.0.2

func (rule V2Rule) GetPath() string

func (V2Rule) GetSiteKey added in v0.0.2

func (rule V2Rule) GetSiteKey() string

func (V2Rule) Validate

func (rule V2Rule) Validate(r *http.Request) bool

type V3Result

type V3Result struct {
	Success  bool    `json:"success"`
	Action   string  `json:"action"`
	Hostname string  `json:"hostname"`
	Score    float64 `json:"score"`
}

type V3Rule

type V3Rule struct {
	Secret    string
	Action    string
	Threshold float64
	Method    string
	Path      string
	SiteKey   string
}

func (V3Rule) GetAction added in v0.0.2

func (rule V3Rule) GetAction() string

func (V3Rule) GetMethod added in v0.0.2

func (rule V3Rule) GetMethod() string

func (V3Rule) GetPath added in v0.0.2

func (rule V3Rule) GetPath() string

func (V3Rule) GetSiteKey added in v0.0.2

func (rule V3Rule) GetSiteKey() string

func (V3Rule) Validate

func (rule V3Rule) Validate(r *http.Request) bool

Jump to

Keyboard shortcuts

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