parse

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSONBody

func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error

DecodeJSONBody will unmarshall a request body into the provided interface type. it will also perform some handy checks on our request to ensure it follows a format we are expecting. big ups @ajmedwards

Types

type MalformedRequest

type MalformedRequest struct {
	Status int
	Msg    string
}

MalformedRequest is a custom error type that holds a response code and a message

func (*MalformedRequest) Error

func (mr *MalformedRequest) Error() string

Error allows for MalformedRequest to implement the Error interface

Jump to

Keyboard shortcuts

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