mrreq

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderKeyCorrelationID - название заголовка содержащего ID запроса.
	// sample: f7479171-83d2-4f64-84ac-892f8c0aaf48.
	HeaderKeyCorrelationID = "X-Correlation-Id"
)
View Source
const (
	// HeaderKeyIdempotencyKey - название заголовка содержащего ключ идемпотентности операции.
	HeaderKeyIdempotencyKey = "X-Idempotency-Key"
)

Variables

View Source
var (
	// ErrHttpRequestCorrelationID - header 'X-Correlation-Id' contains incorrect value.
	ErrHttpRequestCorrelationID = mrerr.NewProto(
		"errHttpRequestCorrelationID", mrerr.ErrorKindInternal, "header 'X-Correlation-Id' contains incorrect value '{{ .value }}'")

	// ErrHttpRequestUserIP - userIP is not IP:port.
	ErrHttpRequestUserIP = mrerr.NewProto(
		"errHttpRequestUserIP", mrerr.ErrorKindInternal, "userIP '{{ .value }}' is not IP:port")

	// ErrHttpRequestParseUserIP - userIP contains incorrect value.
	ErrHttpRequestParseUserIP = mrerr.NewProto(
		"errHttpRequestParseUserIP", mrerr.ErrorKindInternal, "userIP contains incorrect value '{{ .value }}'")
)

Functions

func FormFile added in v0.12.0

func FormFile(r *http.Request, key string) (*multipart.FileHeader, error)

FormFile - comment func.

func FormFiles added in v0.14.0

func FormFiles(r *http.Request, key string, maxMemory int64) ([]*multipart.FileHeader, error)

FormFiles - comment func.

func ParseCorrelationID

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

ParseCorrelationID - comment func.

func ParseDateTime

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

ParseDateTime - comment func.

func ParseEnum

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

ParseEnum - comment func.

func ParseEnumList

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

ParseEnumList - comment func.

func ParseInt64

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

ParseInt64 - comment func.

func ParseInt64List

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

ParseInt64List - comment func.

func ParseLanguage

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

ParseLanguage - comment func.

func ParseNullableBool

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

ParseNullableBool - comment func.

func ParsePageParams

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

ParsePageParams - comment func.

func ParseRangeInt64

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

ParseRangeInt64 - comment func.

func ParseRequiredBool

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

ParseRequiredBool - comment func.

func ParseSortParams

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

ParseSortParams - comment func.

func ParseStr

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

ParseStr - comment func.

func ParseStrList

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

ParseStrList - comment func.

func ParseUUID

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

ParseUUID - comment func.

func ParseUserIP added in v0.18.0

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

ParseUserIP - comment func.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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