Documentation ¶
Index ¶
- Variables
- func WrapFileError(err error, name string) error
- func WrapImageError(err error, name string) error
- type Bool
- type DateTime
- type File
- type FileOptions
- type Image
- type ImageOptions
- type Int64
- type ItemStatus
- type KeyInt32
- type ListPager
- type ListPagerOptions
- type ListSorter
- type ListSorterOptions
- type Parser
- type String
- type UUID
- type Validator
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHttpRequestFileSizeMin - invalid file size - min. ErrHttpRequestFileSizeMin = mrerr.NewProto( "errHttpRequestFileSizeMin", mrerr.ErrorKindUser, "invalid file size, min size = {{ .value }}b") // ErrHttpRequestFileSizeMax - invalid file size - max. ErrHttpRequestFileSizeMax = mrerr.NewProto( "errHttpRequestFileSizeMax", mrerr.ErrorKindUser, "invalid file size, max size = {{ .value }}b") // ErrHttpRequestFileExtension - invalid file extension. ErrHttpRequestFileExtension = mrerr.NewProto( "errHttpRequestFileExtension", mrerr.ErrorKindUser, "invalid file extension: {{ .value }}") // ErrHttpRequestFileTotalSizeMax - invalid file total size - max. ErrHttpRequestFileTotalSizeMax = mrerr.NewProto( "errHttpRequestFileTotalSizeMax", mrerr.ErrorKindUser, "invalid file total size, max total size = {{ .value }}b") // ErrHttpRequestFileContentType - the content type does not match the detected type. ErrHttpRequestFileContentType = mrerr.NewProto( "errHttpRequestFileContentType", mrerr.ErrorKindUser, "the content type '{{ .value }}' does not match the detected type") // ErrHttpRequestFileUnsupportedType - unsupported file type. ErrHttpRequestFileUnsupportedType = mrerr.NewProto( "errHttpRequestFileUnsupportedType", mrerr.ErrorKindUser, "unsupported file type '{{ .value }}'") // ErrHttpRequestImageWidthMax - invalid image width - max. ErrHttpRequestImageWidthMax = mrerr.NewProto( "errHttpRequestImageWidthMax", mrerr.ErrorKindUser, "invalid image width, max size = {{ .value }}px") // ErrHttpRequestImageHeightMax - invalid image height - max. ErrHttpRequestImageHeightMax = mrerr.NewProto( "errHttpRequestImageHeightMax", mrerr.ErrorKindUser, "invalid image height, max size = {{ .value }}px") )
Functions ¶
func WrapFileError ¶ added in v0.12.0
WrapFileError - comment func.
func WrapImageError ¶ added in v0.12.0
WrapImageError - comment func.
Types ¶
type DateTime ¶ added in v0.12.0
type DateTime struct{}
DateTime - comment struct.
func NewDateTime ¶ added in v0.12.0
func NewDateTime() *DateTime
NewDateTime - создаёт объект DateTime.
type File ¶ added in v0.12.0
type File struct {
// contains filtered or unexported fields
}
File - comment struct.
func (*File) FormFile ¶ added in v0.12.0
FormFile - WARNING: you don't forget to call result.Body.Close().
func (*File) FormFileContent ¶ added in v0.12.0
FormFileContent - only for short files.
type FileOptions ¶ added in v0.12.0
type FileOptions struct { AllowedMimeTypes *mrlib.MimeTypeList MinSize int64 MaxSize int64 MaxTotalSize int64 MaxFiles int CheckRequestContentType bool }
FileOptions - опции для создания File.
type Image ¶ added in v0.12.0
type Image struct {
// contains filtered or unexported fields
}
Image - comment struct.
func NewImage ¶ added in v0.12.0
func NewImage(opts ImageOptions) *Image
NewImage - создаёт объект Image.
func (*Image) FormImage ¶ added in v0.12.0
FormImage - WARNING: you don't forget to call result.Body.Close().
func (*Image) FormImageContent ¶ added in v0.12.0
FormImageContent - only for short files.
func (*Image) FormImages ¶ added in v0.14.0
FormImages - comment method.
type ImageOptions ¶ added in v0.12.0
type ImageOptions struct { File FileOptions MaxWidth int32 MaxHeight int32 CheckBody bool }
ImageOptions - опции для создания Image.
type Int64 ¶ added in v0.12.0
type Int64 struct {
// contains filtered or unexported fields
}
Int64 - comment struct.
func NewInt64 ¶ added in v0.12.0
func NewInt64(pathFunc mrserver.RequestParserParamFunc) *Int64
NewInt64 - создаёт объект Int64.
func (*Int64) FilterInt64 ¶ added in v0.12.0
FilterInt64 - comment method.
func (*Int64) FilterInt64List ¶ added in v0.12.0
FilterInt64List - comment method.
func (*Int64) FilterRangeInt64 ¶ added in v0.12.0
FilterRangeInt64 - comment method.
type ItemStatus ¶
type ItemStatus struct {
// contains filtered or unexported fields
}
ItemStatus - comment struct.
func NewItemStatusWithDefault ¶ added in v0.14.2
func NewItemStatusWithDefault(items []mrenum.ItemStatus) *ItemStatus
NewItemStatusWithDefault - создаёт объект ItemStatus.
func (*ItemStatus) FilterStatusList ¶
func (p *ItemStatus) FilterStatusList(r *http.Request, key string) []mrenum.ItemStatus
FilterStatusList - comment method.
type KeyInt32 ¶
type KeyInt32 struct {
// contains filtered or unexported fields
}
KeyInt32 - comment struct.
func NewKeyInt32 ¶
func NewKeyInt32(pathFunc mrserver.RequestParserParamFunc) *KeyInt32
NewKeyInt32 - создаёт объект KeyInt32.
func (*KeyInt32) FilterKeyInt32 ¶
FilterKeyInt32 - comment method.
func (*KeyInt32) FilterKeyInt32List ¶
FilterKeyInt32List - comment method.
type ListPager ¶ added in v0.14.0
type ListPager struct {
// contains filtered or unexported fields
}
ListPager - comment struct.
func NewListPager ¶ added in v0.14.0
func NewListPager(opts ListPagerOptions) *ListPager
NewListPager - создаёт объект ListPager.
func (*ListPager) PageParams ¶ added in v0.14.0
func (p *ListPager) PageParams(r *http.Request) mrtype.PageParams
PageParams - comment method.
type ListPagerOptions ¶ added in v0.14.0
type ListPagerOptions struct { ParamNamePageIndex string ParamNamePageSize string PageSizeMax uint64 PageSizeDefault uint64 }
ListPagerOptions - опции для создания ListPager.
type ListSorter ¶ added in v0.14.0
type ListSorter struct {
// contains filtered or unexported fields
}
ListSorter - comment struct.
func NewListSorter ¶ added in v0.14.0
func NewListSorter(opts ListSorterOptions) *ListSorter
NewListSorter - создаёт объект ListSorter.
func (*ListSorter) SortParams ¶ added in v0.14.0
func (p *ListSorter) SortParams(r *http.Request, sorter mrview.ListSorter) mrtype.SortParams
SortParams - comment method.
type ListSorterOptions ¶ added in v0.14.0
ListSorterOptions - опции для создания ListSorter.
type Parser ¶ added in v0.14.0
type Parser struct { *Bool *DateTime *Int64 *KeyInt32 *ListSorter *ListPager *String *UUID *Validator *File *Image }
Parser - comment struct.
type String ¶ added in v0.12.0
type String struct {
// contains filtered or unexported fields
}
String - comment struct.
func NewString ¶ added in v0.12.0
func NewString(pathFunc mrserver.RequestParserParamFunc) *String
NewString - создаёт объект String.
func (*String) FilterString ¶ added in v0.12.0
FilterString - comment method.
func (*String) PathParamString ¶ added in v0.12.0
PathParamString - comment method.
type UUID ¶
type UUID struct {
// contains filtered or unexported fields
}
UUID - comment struct.
func NewUUID ¶
func NewUUID(pathFunc mrserver.RequestParserParamFunc) *UUID
NewUUID - создаёт объект UUID.
func (*UUID) FilterUUID ¶
FilterUUID - comment method.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator - comment struct.
func NewValidator ¶
func NewValidator(decoder mrserver.RequestDecoder, validator mrview.Validator) *Validator
NewValidator - создаёт объект Validator.