request

package
v0.0.0-...-39f3c58 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxUserIDKey requestContextKey = iota
	CtxOrgIDKey
	CtxOrgSubdomainKey
)

Variables

View Source
var ErrInvalidPathParam = errors.New("invalid path parameter")

Functions

func DecodeAndValidateJSON

func DecodeAndValidateJSON(r io.Reader, v any) error

DecodeAndValidateJSON decodes a JSON payload from the given reader into the given value. It also validates the fields using the validator. If the validation fails, it returns a validation error.

func URLParam

func URLParam(r *http.Request, param string) string

GetURLParam returns the unescaped value of a URL parameter from the request. This helps prevent dependency on a specific web framework.

func URLParamID

func URLParamID(r *http.Request, param string) (int64, error)

GetURLParamID returns the value of a ID URL parameter from the request as an int64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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