Documentation
¶
Overview ¶
Package server defines internal behaviour.
Package server defines internal behaviour.
Package server defines internal behaviour.
Package server defines internal behaviour.
Index ¶
- func Error(w http.ResponseWriter, code int, message string)
- func JSON(w http.ResponseWriter, code int, payload interface{})
- func JSONWithCookie(w http.ResponseWriter, code int, payload interface{}, cookie http.Cookie)
- func NewUserRouter(u root.UserService, router *mux.Router) *mux.Router
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, code int, message string)
Error explains what went wrong.
func JSON ¶
func JSON(w http.ResponseWriter, code int, payload interface{})
JSON marshals a JSON payload and writes it out to the response, with some headers.
func JSONWithCookie ¶
func JSONWithCookie(w http.ResponseWriter, code int, payload interface{}, cookie http.Cookie)
JSONWithCookie marshals a JSON payload, sets a cookie, and writes out to the response, with some headers.
func NewUserRouter ¶
NewUserRouter sets up a Router with some functions to handle various routes.
Types ¶
Click to show internal directories.
Click to hide internal directories.