mrreq

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 11 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 ParseCorrelationID added in v0.7.0

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

func ParseDateTime added in v0.8.2

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

func ParseEnum added in v0.6.0

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

func ParseEnumList added in v0.6.0

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

func ParseInt64 added in v0.6.0

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

func ParseInt64List added in v0.6.0

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

func ParseItemStatusList added in v0.6.0

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

func ParseLanguage added in v0.6.0

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

func ParseNullableBool added in v0.7.0

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

func ParsePageParams added in v0.7.0

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

func ParseRangeInt64 added in v0.7.0

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

func ParseRequiredBool added in v0.7.0

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

func ParseSortParams added in v0.7.0

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

func ParseStr added in v0.6.0

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

func ParseStrList added in v0.6.0

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

func ParseUserIp added in v0.6.0

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