request

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v0.7.2

func Debug(r *http.Request) (details string)

Debug is a convenience wrapper around httputil.DumpRequest

func Float64 added in v0.5.0

func Float64(r *http.Request, key interface{}) (value float64, ok bool)

Float64 is a convenience wrapper around Value[float64]()

func GetEnjinID added in v0.5.0

func GetEnjinID(r *http.Request) (name string)

func GetHomePath added in v0.5.0

func GetHomePath(r *http.Request) (path string)

func GetRequestID

func GetRequestID(r *http.Request) (id string)

func Int added in v0.5.0

func Int(r *http.Request, key interface{}) (value int, ok bool)

Int is a convenience wrapper around Value[int]()

func ParseDomainUrl added in v0.5.0

func ParseDomainUrl(r *http.Request) (formal string)

func QueryFormValue added in v0.5.0

func QueryFormValue(r *http.Request, key string) (value string)

func SafeParseForm added in v0.5.0

func SafeParseForm(r *http.Request) (form map[string]interface{})

SafeParseForm sanitizes all r.Form values and returns a flat form context.Context with only the first value of each key included (similar to r.FormValue)

func SafeQueryFormEmail added in v0.5.0

func SafeQueryFormEmail(r *http.Request, key string) (address string)

func SafeQueryFormHash10 added in v0.5.0

func SafeQueryFormHash10(r *http.Request, key string) (shasum string)

func SafeQueryFormSixDigits added in v0.5.0

func SafeQueryFormSixDigits(r *http.Request, key string) (digits string)

func SafeQueryFormValue added in v0.5.0

func SafeQueryFormValue(r *http.Request, key string) (sanitized string)

func Set added in v0.5.0

func Set(r *http.Request, keyValuePairs ...interface{}) (m *http.Request)

Set is a convenience wrapper for cloning the given request with one or more context key+value pairs added, will panic if the number of key+value pairs is not balanced (even)

func SetHomePath added in v0.5.0

func SetHomePath(r *http.Request, path string) (modified *http.Request)

func String added in v0.5.0

func String(r *http.Request, key interface{}) (value string, ok bool)

String is a convenience wrapper around Value[string]()

func Value added in v0.5.0

func Value[T interface{}](r *http.Request, key interface{}) (value T, ok bool)

Value is a convenience wrapper for getting a generic value type from a given request context

Types

type Key added in v0.5.0

type Key string
const (
	KeyEnjinID  Key = "enjin-id"
	KeyHomePath Key = "home-path"
)

func (Key) String added in v0.5.0

func (r Key) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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