Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetHandler ¶
type GetHandler struct {
// contains filtered or unexported fields
}
GetHandler is the HTTP handler for the "Get Person" endpoint In this simplified example we are assuming all possible errors are user errors and returning "bad request" HTTP 400 or "not found" HTTP 404 There are some programmer errors possible but hopefully these will be caught in testing.
func NewGetHandler ¶
func NewGetHandler(model GetModel) *GetHandler
NewGetHandler is the constructor for GetHandler
func (*GetHandler) ServeHTTP ¶
func (h *GetHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
ServeHTTP implements http.Handler
type ListHandler ¶
type ListHandler struct {
// contains filtered or unexported fields
}
ListHandler is the HTTP handler for the "List Do people" endpoint In this simplified example we are assuming all possible errors are system errors (HTTP 500)
func NewListHandler ¶
func NewListHandler(model ListModel) *ListHandler
NewLister is the constructor for ListHandler
func (*ListHandler) ServeHTTP ¶
func (h *ListHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
ServeHTTP implements http.Handler
type RegisterHandler ¶
type RegisterHandler struct {
// contains filtered or unexported fields
}
RegisterHandler is the HTTP handler for the "Register" endpoint In this simplified example we are assuming all possible errors are user errors and returning "bad request" HTTP 400. There are some programmer errors possible but hopefully these will be caught in testing.
func NewRegisterHandler ¶
func NewRegisterHandler(model RegisterModel) *RegisterHandler
NewRegisterHandler is the constructor for RegisterHandler
func (*RegisterHandler) ServeHTTP ¶
func (h *RegisterHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
ServeHTTP implements http.Handler
type RegisterModel ¶
RegisterModel will validate and save a registration