Documentation ¶
Overview ¶
This file is autogenerated. Do not modify
This file is autogenerated. Do not modify
Index ¶
- func AppendRoutes(router *mux.Router, controllers ...HttpController) *mux.Router
- func WriteAnyResponse(w http.ResponseWriter, statuscode int, data interface{}) (int, error)
- func WriteByteResponse(w http.ResponseWriter, statuscode int, data []byte) (int, error)
- func WriteCustomJSONResponse(w http.ResponseWriter, statuscode int, data []byte) (int, error)
- func WriteDefaultResponse(w http.ResponseWriter, status int) (int, error)
- func WriteJSONResponse(w http.ResponseWriter, statuscode int, data JSONWriter) (int, error)
- func WriteYAMLResponse(w http.ResponseWriter, statuscode int, data YAMLWriter) (int, error)
- type HttpController
- type JSONWriter
- type Route
- type YAMLWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendRoutes ¶
func AppendRoutes(router *mux.Router, controllers ...HttpController) *mux.Router
AppendRoutes appends the routes of one or more Controllers to a mux.Router. If a nil router is passed, a new router will be created here.
func WriteAnyResponse ¶
func WriteAnyResponse(w http.ResponseWriter, statuscode int, data interface{}) (int, error)
WriteTextResponse sets an HTTP response with the provided status-code and string.
func WriteByteResponse ¶
func WriteCustomJSONResponse ¶
WriteJSONResponse sets an HTTP response with the provided status-code and JSON data.
func WriteDefaultResponse ¶
func WriteDefaultResponse(w http.ResponseWriter, status int) (int, error)
WriteDefaultResponse sets the body of a response with the text associated with the HTTP status.
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, statuscode int, data JSONWriter) (int, error)
WriteJSONResponse sets an HTTP response with the provided status-code and JSON body.
func WriteYAMLResponse ¶
func WriteYAMLResponse(w http.ResponseWriter, statuscode int, data YAMLWriter) (int, error)
WriteYAMLResponse sets an HTTP response with the provided status-code and JSON body.
Types ¶
type HttpController ¶
type HttpController interface {
Routes() []Route
}
Controller creates a set of HTTP routes.
type JSONWriter ¶
JSONWriter offers conversion to JSON.
type Route ¶
type Route struct { Name string Method string Path string Handler http.HandlerFunc }
Route defines the parameters for an api endpoint.
type YAMLWriter ¶
type YAMLWriter interface {
ToYaml() string
}
YAMLWriter offers conversion to YAML.
Directories ¶
Path | Synopsis |
---|---|
This file is autogenerated.
|
This file is autogenerated. |
This file is autogenerated.
|
This file is autogenerated. |