Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct {
Statistics Statistics
}
Our application wide data containers
type Error ¶
Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.
func HandleApiNotFound ¶
func HandleApiNotFound(env *Environment, w http.ResponseWriter, r *http.Request) Error
func HandleStatsCounts ¶
func HandleStatsCounts(env *Environment, w http.ResponseWriter, r *http.Request) Error
type Handler ¶
type Handler struct { Env *Environment Handle HandlerHandleFunc }
The Handler struct that takes a configured Environment and a function matching our useful signature.
type HandlerHandleFunc ¶
type HandlerHandleFunc func(e *Environment, w http.ResponseWriter, r *http.Request) Error
define an extended version of http.HandlerFunc
type HttpRoute ¶
type HttpRoute struct { Name string Method string Pattern string HandlerFunc HandlerHandleFunc }
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func Run ¶
func Run(config Config, env *Environment) (httpServer *HttpServer)
func (*HttpServer) Shutdown ¶
func (s *HttpServer) Shutdown()
type Statistics ¶
type Statistics interface { Enabled() bool GetHierarchicalCountsStructless() interface{} }
type StatusError ¶
StatusError represents an error with an associated HTTP status code.
func (StatusError) Error ¶
func (statusError StatusError) Error() string
Allows StatusError to satisfy the error interface.
func (StatusError) Status ¶
func (statusError StatusError) Status() int
Returns our HTTP status code.
Click to show internal directories.
Click to hide internal directories.