request

package
v0.0.0-...-91b10cc Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPaginator

func NewPaginator(pageSize, page int, sort []string, sortSafeMap map[string]bool) *paginator

func QueryInt

func QueryInt(r *http.Request, key string, defaultValue int) (int, error)

QueryInt parses an integer from a query parameter. Returns defaultValue if the query parameter was empty, because query parameters are always optional.

func QueryParameter

func QueryParameter(r *http.Request, key string) string

QueryParameter extracts a given key from query parameters. Returns an empty string if parameters wasn't found

func QueryString

func QueryString(r *http.Request, key string, defaultValue string) (string, error)

QueryString parses a string from a query parameter. Returns defaultValue if the query parameter was empty, because query parameters are always optional.

func QueryStrings

func QueryStrings(r *http.Request, key string, defaultValue string) ([]string, error)

QueryString parses strings from a query parameter. Returns defaultValue if the query parameter was empty, because query parameters are always optional.

func ReadJSON

func ReadJSON(w http.ResponseWriter, r *http.Request, dst interface{}) error

ReadJSON parses JSON into dst struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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