turnstile

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	URL *url.URL
	// contains filtered or unexported fields
}

func New

func New(baseURL, secret string, enabled bool) (*Service, error)

func (*Service) Verify

func (s *Service) Verify(ctx context.Context, ipAddress, token string) error

type Verifier

type Verifier interface {
	Verify(ctx context.Context, ipAddress, token string) error
}

type VerifyRequest

type VerifyRequest struct {
	Secret   string `json:"secret"`
	Response string `json:"response"`
	RemoteIP string `json:"remoteip,omitempty"` //nolint:tagliatelle
}

type VerifyResponse

type VerifyResponse struct {
	Success bool `json:"success"`
}

Jump to

Keyboard shortcuts

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