Documentation ¶
Index ¶
Constants ¶
const DefaultMaxMemory = 32 << 20 // 32mb
DefaultMaxMemory defines the default max memory bytes that will be used when parsing a form request body.
Variables ¶
This section is empty.
Functions ¶
func BindBody ¶
func BindBody(c echo.Context, i interface{}) error
BindBody binds request body content to i.
This is similar to `echo.BindBody()`, but for JSON requests uses custom json reader that **copies** the request body, allowing multiple reads.
func CopyJsonBody ¶ added in v0.8.0
CopyJsonBody reads the request body into i by creating a copy of `r.Body` to allow multiple reads.
func FindUploadedFiles ¶
FindUploadedFiles extracts all form files of "key" from a http request and returns a slice with filesystem.File instances (if any).
func NormalizeUrl ¶ added in v0.5.0
NormalizeUrl removes duplicated slashes from a url path.
Types ¶
type Serializer ¶ added in v0.16.0
type Serializer struct { echo.DefaultJSONSerializer FieldsParam string }
Serializer represents custom REST JSON serializer based on echo.DefaultJSONSerializer, with support for additional generic response data transformation (eg. fields picker).
func (*Serializer) Serialize ¶ added in v0.16.0
func (s *Serializer) Serialize(c echo.Context, i any, indent string) error
Serialize converts an interface into a json and writes it to the response.
It also provides a generic response data fields picker via the FieldsParam query parameter (default to "fields").