top

Package httpparms provides helper functions and types to load the content of an HTTP request into a Go struct. It supports loading the query string parameters, the form-encoded body and the JSON-encoded body. If the struct implements the "Validator" interface, it also validates the values.

It supports various form decoders and JSON unmarshalers. Common such packages that can be used for forms are:

- github.com/go-playground/form (requires the FormDecoderAdapter)
- github.com/gorilla/schema

Common packages that can be used for JSON are:

- encoding/json in the standard library
- pquerna/ffjson/ffjson

The package also provides support to extract parameter names that failed validation so that a useful error message can be given to the caller.

Test imports 7 package(s) ΒΆ

  1. github.com/pquerna/ffjson/ffjson
  2. github.com/stretchr/testify/assert
  3. github.com/go-playground/form
  4. github.com/pkg/errors
  5. github.com/gorilla/schema
  6. github.com/hashicorp/go-multierror
  7. github.com/stretchr/testify/require