Documentation ¶
Index ¶
- func NewDeleteRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewGetRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewHeadRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewOptionsRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewPostRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewPutRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewRoute(name, method, path string, handler types.APIFunc, ...) types.Route
- func WriteData(w http.ResponseWriter, code int, v []byte) error
- func WriteJSON(w http.ResponseWriter, code int, v interface{}) error
- func WriteResponse(w http.ResponseWriter, rec *httptest.ResponseRecorder)
- func WriteTask(ctx types.Context, config gofig.Config, w http.ResponseWriter, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeleteRoute ¶
func NewDeleteRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewDeleteRoute initializes a new route with the http method DELETE.
func NewGetRoute ¶
func NewGetRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewGetRoute initializes a new route with the http method GET.
func NewHeadRoute ¶
func NewHeadRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewHeadRoute initializes a new route with the http method HEAD.
func NewOptionsRoute ¶
func NewOptionsRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewOptionsRoute initializes a new route with the http method OPTIONS
func NewPostRoute ¶
func NewPostRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewPostRoute initializes a new route with the http method POST.
func NewPutRoute ¶
func NewPutRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewPutRoute initializes a new route with the http method PUT.
func NewRoute ¶
func NewRoute( name, method, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewRoute initialies a new local route for the reouter
func WriteData ¶
func WriteData(w http.ResponseWriter, code int, v []byte) error
WriteData writes the value v to the http response stream as binary.
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, code int, v interface{}) error
WriteJSON writes the value v to the http response stream as json with standard json encoding.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, rec *httptest.ResponseRecorder)
WriteResponse writes a recorded response to a ResponseWriter.
Types ¶
This section is empty.