[GIN-001] - Add TOML bining for gin (#3081)

Co-authored-by: GitstartHQ <gitstart@users.noreply.github.com>
This commit is contained in:
Valentine Oragbakosi
2022-05-27 16:34:43 -08:00
committed by GitHub
parent aa6002134e
commit ed03102ef0
12 changed files with 157 additions and 3 deletions

View File

@ -22,6 +22,7 @@ const (
MIMEMSGPACK = "application/x-msgpack"
MIMEMSGPACK2 = "application/msgpack"
MIMEYAML = "application/x-yaml"
MIMETOML = "application/toml"
)
// Binding describes the interface which needs to be implemented for binding the
@ -83,6 +84,7 @@ var (
YAML = yamlBinding{}
Uri = uriBinding{}
Header = headerBinding{}
TOML = tomlBinding{}
)
// Default returns the appropriate Binding instance based on the HTTP method
@ -103,6 +105,8 @@ func Default(method, contentType string) Binding {
return MsgPack
case MIMEYAML:
return YAML
case MIMETOML:
return TOML
case MIMEMultipartPOSTForm:
return FormMultipart
default: // case MIMEPOSTForm: