httputil

package
v0.0.0-...-2db764d Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(message, description string, err error) error

func InternalServerError

func InternalServerError(message, description string, err error) error

func NotFound

func NotFound(message, description string, err error) error

func ParseBody

func ParseBody(r *http.Request, v interface{}) error

func ResponseAsJSON

func ResponseAsJSON(w http.ResponseWriter, statusCode int, v interface{})

func ResponseError

func ResponseError(w http.ResponseWriter, httpErr error)

func ResponseOK

func ResponseOK(w http.ResponseWriter, v interface{})

Types

type Error

type Error struct {
	Message     string `json:"message"`
	Description string `json:"description"`
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

func (*Error) StatusCode

func (e *Error) StatusCode() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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