Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, err error, httpStatus int)
Types ¶
type Handler404 ¶
type Handler404 struct{}
create a 404 handler - default content type is json
func (*Handler404) ServeHTTP ¶
func (m *Handler404) ServeHTTP(w http.ResponseWriter, req *http.Request)
type ResponseError ¶
type ResponseStatus ¶
type ResponseStatus struct { ErrorCode string `json:"errorCode,omitempty"` Message string `json:"message,omitempty"` Errors []ResponseError `json:"errors,omitempty"` }
type Service ¶
type Service struct { Name string Description string Params string Port string Version string // contains filtered or unexported fields }
func (*Service) Handler404 ¶
func (m *Service) Handler404(w http.ResponseWriter, req *http.Request)
func (*Service) RegisterPath ¶
func (m *Service) RegisterPath(path string, httpMethod string, f ServiceHandler, authenticate bool)
func (*Service) RequestHandler ¶
func (m *Service) RequestHandler(w http.ResponseWriter, r *http.Request, p httprouter.Params)
type ServiceHandler ¶
type ServiceHandler func(http.ResponseWriter, *http.Request, httprouter.Params) (ReturnData, error)
Click to show internal directories.
Click to hide internal directories.