request

package
v1.24.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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 added in v1.23.0

func HeaderOrQuery[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 added in v1.23.0

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"`
	Filter string `json:"filter,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