Documentation ¶
Index ¶
- Constants
- func WriteJSONStatus(rw http.ResponseWriter, status, message string, statusCode int)
- type Api
- func (a *Api) Handle(handlers map[string]Handler) http.Handler
- func (a *Api) HealthHandler(rw http.ResponseWriter, r *http.Request) *DetailedError
- func (a *Api) HomeHandler(rw http.ResponseWriter, r *http.Request) *DetailedError
- func (a *Api) Run() error
- func (a *Api) VersionHandler(rw http.ResponseWriter, r *http.Request) *DetailedError
- type DetailedError
- type ExtendedJSONStatus
- type Handler
- type JSONStatus
Constants ¶
View Source
const (
DEFAULT_STATSD_RATE = 1.0
)
Variables ¶
This section is empty.
Functions ¶
func WriteJSONStatus ¶
func WriteJSONStatus(rw http.ResponseWriter, status, message string, statusCode int)
Types ¶
type Api ¶
type Api struct { Config *config.Config Version string Dependencies *deps.Dependencies }
func (*Api) HealthHandler ¶
func (a *Api) HealthHandler(rw http.ResponseWriter, r *http.Request) *DetailedError
func (*Api) HomeHandler ¶
func (a *Api) HomeHandler(rw http.ResponseWriter, r *http.Request) *DetailedError
func (*Api) VersionHandler ¶
func (a *Api) VersionHandler(rw http.ResponseWriter, r *http.Request) *DetailedError
type DetailedError ¶
type ExtendedJSONStatus ¶
type Handler ¶
type Handler func(w http.ResponseWriter, r *http.Request) *DetailedError
Borrowed from http://laicos.com/writing-handsome-golang-middleware/
type JSONStatus ¶
Click to show internal directories.
Click to hide internal directories.