Documentation
¶
Index ¶
- Constants
- Variables
- type JSONObject
- type RequestValues
- func (p *RequestValues) Body() ([]byte, error)
- func (p *RequestValues) BodyText() (string, error)
- func (p *RequestValues) ContentType() string
- func (p *RequestValues) Form() (url.Values, error)
- func (p *RequestValues) GetString(key string) (string, error)
- func (p *RequestValues) JSONObject() (JSONObject, error)
- func (p *RequestValues) Query() url.Values
- func (p *RequestValues) Values(key string) (vals []interface{}, err error)
- type TurnstileSite
Constants ¶
View Source
const TurnstileVerifyTimeout = 5 * time.Second
Variables ¶
View Source
var ( ErrAmbiguousValues = errors.New("differing values found") ErrValueUnexpectedType = errors.New("value is an unexpected type") )
Functions ¶
This section is empty.
Types ¶
type JSONObject ¶
type JSONObject map[string]interface{}
type RequestValues ¶
type RequestValues struct {
// contains filtered or unexported fields
}
func ParseRequest ¶
func ParseRequest(req *http.Request) *RequestValues
returns a *RequestValues which lazily parses body and url values
func (*RequestValues) Body ¶
func (p *RequestValues) Body() ([]byte, error)
func (*RequestValues) BodyText ¶
func (p *RequestValues) BodyText() (string, error)
func (*RequestValues) ContentType ¶
func (p *RequestValues) ContentType() string
func (*RequestValues) GetString ¶
func (p *RequestValues) GetString(key string) (string, error)
returns the request value associated with key. if key is not found, returns empty string and nil error. if differing values are found, returns the first value and ErrAmbiguousValues. if an associated value is not a string, returns the first string, if any, and ErrValueUnexpectedType. may also return errors related to parsing the request.
func (*RequestValues) JSONObject ¶
func (p *RequestValues) JSONObject() (JSONObject, error)
func (*RequestValues) Query ¶
func (p *RequestValues) Query() url.Values
func (*RequestValues) Values ¶
func (p *RequestValues) Values(key string) (vals []interface{}, err error)
returns all request values associated with key. parses values from request body and url based on method and content-type.
type TurnstileSite ¶
type TurnstileSite struct {
Secret string
}
Click to show internal directories.
Click to hide internal directories.