handlers

package
v0.0.0-...-b37488e Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2014 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// HTTP header defaults
	HEADER_DEFAULTS = map[string]string{
		"Access-Control-Allow-Origin": "*",
		"Content-Type":                "application/json",
	}
)

Functions

func BasicAuth

func BasicAuth(pass handler) handler

func DeleteItem

func DeleteItem(modelname string, res http.ResponseWriter, req *http.Request, dbmap *gorp.DbMap)

func DeleteUser

func DeleteUser(res http.ResponseWriter, req *http.Request, dbmap *gorp.DbMap)

func GetUser

func GetUser(res http.ResponseWriter, req *http.Request, dbmap *gorp.DbMap)

func GetUsers

func GetUsers(res http.ResponseWriter, req *http.Request, dbmap *gorp.DbMap)

func PatchUser

func PatchUser(res http.ResponseWriter, req *http.Request, dbmap *gorp.DbMap)

func PostUser

func PostUser(res http.ResponseWriter, req *http.Request, dbmap *gorp.DbMap)

For another model without hooks (i.e. password->hash), would likely want to use parseFormValues.

func Respond

func Respond(i interface{}, err error, res http.ResponseWriter)

func SetHeaders

func SetHeaders(res http.ResponseWriter, code int)

func Validate

func Validate(username, password string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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