mrreq

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FactoryErrHttpRequestCorrelationID = NewFactory(
		"errHttpRequestCorrelationID", ErrorKindInternalNotice, "header 'CorrelationID' contains incorrect value '{{ .value }}'")

	FactoryErrHttpRequestUserIP = NewFactory(
		"errHttpRequestUserIP", ErrorKindInternalNotice, "UserIP '{{ .value }}' is not IP:port")

	FactoryErrHttpRequestParseUserIP = NewFactory(
		"errHttpRequestParseUserIP", ErrorKindInternalNotice, "UserIP contains incorrect value '{{ .value }}'")
)

Functions

func File

func File(r *http.Request, key string) (mrtype.File, error)

File - WARNING you don't forget to call result.Body.Close()

func FileContent

func FileContent(r *http.Request, key string) (mrtype.FileContent, error)

FileContent - only for short files

func ParseCorrelationID

func ParseCorrelationID(r *http.Request) (string, error)

func ParseDateTime

func ParseDateTime(r *http.Request, key string, required bool) (time.Time, error)

func ParseEnum

func ParseEnum(r *http.Request, key string, required bool) (string, error)

func ParseEnumList

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

func ParseInt64

func ParseInt64(r *http.Request, key string, required bool) (int64, error)

func ParseInt64List

func ParseInt64List(r *http.Request, key string) ([]int64, error)

func ParseItemStatusList

func ParseItemStatusList(r *http.Request, key string, defaultItems []mrenum.ItemStatus) ([]mrenum.ItemStatus, error)

func ParseLanguage

func ParseLanguage(r *http.Request) []string

func ParseNullableBool

func ParseNullableBool(r *http.Request, key string) (*bool, error)

func ParsePageParams

func ParsePageParams(r *http.Request, keyIndex, keySize string) (mrtype.PageParams, error)

func ParseRangeInt64

func ParseRangeInt64(r *http.Request, key string) (mrtype.RangeInt64, error)

func ParseRequiredBool

func ParseRequiredBool(r *http.Request, key string) (bool, error)

func ParseSortParams

func ParseSortParams(r *http.Request, keyField, keyDirection string) (mrtype.SortParams, error)

func ParseStr

func ParseStr(r *http.Request, key string, required bool) (string, error)

func ParseStrList

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

func ParseUUID

func ParseUUID(r *http.Request, key string, required bool) (uuid.UUID, error)

func ParseUserIp

func ParseUserIp(r *http.Request) (net.IP, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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