Documentation ¶
Index ¶
- func Handler(prefix string, options ...rest.Option) http.Handlerdeprecated
- func PackHandler(method string, handler http.Handler, placeholders ...string) rest.Handlerdeprecated
- func PackHandlerFunc(method string, handler http.HandlerFunc, placeholders ...string) rest.HandlerFuncdeprecated
- func Routing(prefix string, options ...rest.Option) (string, gohttp.Handler)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PackHandler
deprecated
PackHandler packs rest.Handler into rest.Handler using chi router.
mux := http.NewServeMux() mux.Handle( chi.Routing("/v1/", rest.WithPackedHandlers( chi.PackHandler(gohttp.MethodGet, api.HandlerX), chi.PackHandler(gohttp.MethodGet, api.HandlerY), chi.PackHandler(gohttp.MethodGet, api.HandlerZ), ), ), )
Deprecated: use go.octolab.org/toolkit/protocol/http/middleware/chi.Converter instead.
func PackHandlerFunc
deprecated
func PackHandlerFunc(method string, handler http.HandlerFunc, placeholders ...string) rest.HandlerFunc
PackHandlerFunc packs rest.HandlerFunc into rest.HandlerFunc using chi router.
mux := http.NewServeMux() mux.HandleFunc( api.V2("/v2/", chi.PackHandlerFunc(gohttp.MethodGet, api.HandlerFuncX), chi.PackHandlerFunc(gohttp.MethodGet, api.HandlerFuncY), chi.PackHandlerFunc(gohttp.MethodGet, api.HandlerFuncZ), ), )
Deprecated: use go.octolab.org/toolkit/protocol/http/middleware/chi.Converter instead.
func Routing
deprecated
Routing is a glue for a http listener and the github.com/go-chi/chi router.
mux := http.NewServeMux() mux.Handle(chi.Routing("/api/", rest.WithMiddlewares(...), rest.WithHandlers(...))) http.ListenAndServe("localhost:8080", mux)
Deprecated: use go.octolab.org/toolkit/protocol/http/router/rest instead.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.