httputils

package
v0.0.0-...-d94e6cf Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteError

func WriteError(w http.ResponseWriter, err models.Error) error

WriteError decodes an error and sends it in the response.

func WriteJSON

func WriteJSON(w http.ResponseWriter, code int, v interface{}) error

WriteJSON writes the value v to the http response stream as json with standard json encoding.

Types

type APIFunc

type APIFunc func(w http.ResponseWriter, r *http.Request, vars map[string]string) error

APIFunc is an adapter to allow the use of ordinary functions as TakeANote API endpoints. Any function that has the appropriate signature can be register as a API endpoint

Jump to

Keyboard shortcuts

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