form

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r *http.Request, dst interface{}) error

Decode decodes the request body into dst, which must be a pointer of a struct. If there is no body or the body is empty, it will take the query string as the body. If the Content-Type is multipart/form-data.

func DecodeUUID

func DecodeUUID(vals []string) (interface{}, error)

DecodeUUID a single uuid from a string and returns an error if there is a problem

func DecodeUUIDSlice

func DecodeUUIDSlice(vals []string) (interface{}, error)

DecodeUUIDSlice decodes a slice of uuids from a string and returns an error if there is a problem

func RegisterCustomTypeFunc

func RegisterCustomTypeFunc(fn form.DecodeCustomTypeFunc, kind interface{})

RegisterCustomTypeFunc registers a custom type decoder func for a type. This is useful when you want to use a custom type or a type from an external package like uuid.UUID and want to decode it from a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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