request

package
v0.0.0-...-20fbe64 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Body

func Body(r *http.Request, into any) error
func Header[T any](r *http.Request, key string, defaultValue T) T

func HeaderOrQuery

func HeaderOrQuery[T any](r *http.Request, key string, defaultValue T) T

func Path

func Path[T any](r *http.Request, key string, defaultValue T) T

func Query

func Query[T any](r *http.Request, key string, defaultValue T) T

func ValueOrDefault

func ValueOrDefault[T any](val string, defaultValue T) T

nolint: forcetypeassert,gomnd,ifshort ValueOrDefault return default value if empty string

Types

type ListOptions

type ListOptions struct {
	Page   int    `json:"page,omitempty"`
	Size   int    `json:"size,omitempty"`
	Search string `json:"search,omitempty"`
	Sort   string `json:"sort,omitempty"`
}

func GetListOptions

func GetListOptions(r *http.Request) ListOptions

nolint: gomnd

Jump to

Keyboard shortcuts

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