gitea: Index | Files

package recaptcha

import ""


Package Files


func Verify Uses

func Verify(ctx context.Context, response string) (bool, error)

Verify calls Google Recaptcha API to verify token

type ErrorCode Uses

type ErrorCode string

ErrorCode is a reCaptcha error

func (ErrorCode) Error Uses

func (e ErrorCode) Error() string

Error fulfills the error interface

func (ErrorCode) String Uses

func (e ErrorCode) String() string

String fulfills the Stringer interface

type Response Uses

type Response struct {
    Success     bool        `json:"success"`
    ChallengeTS string      `json:"challenge_ts"`
    Hostname    string      `json:"hostname"`
    ErrorCodes  []ErrorCode `json:"error-codes"`

Response is the structure of JSON returned from API

Package recaptcha imports 9 packages (graph) and is imported by 8 packages. Updated 2020-12-13. Refresh now. Tools for package owners.