router
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- type ExperimentalRoute
- type Route
- func Experimental(r Route) Route
- func NewDeleteRoute(path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- func NewGetRoute(path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- func NewHeadRoute(path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- func NewOptionsRoute(path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- func NewPostRoute(path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- func NewPutRoute(path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- func NewRoute(method, path string, handler httputils.APIFunc, opts ...RouteWrapper) Route
- type RouteWrapper
- type Router
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeExperimentalRoute¶
type ExperimentalRoute interface {RouteEnable()Disable()}ExperimentalRoute defines an experimental API route that can be enabled or disabled.
typeRoute¶
type Route interface {// Handler returns the raw function to create the http handler.Handler()httputils.APIFunc// Method returns the http method that the route responds to.Method()string// Path returns the subpath where the route responds to.Path()string}Route defines an individual API route in the docker server.
funcNewDeleteRoute¶
func NewDeleteRoute(pathstring, handlerhttputils.APIFunc, opts ...RouteWrapper)Route
NewDeleteRoute initializes a new route with the http method DELETE.
funcNewGetRoute¶
func NewGetRoute(pathstring, handlerhttputils.APIFunc, opts ...RouteWrapper)Route
NewGetRoute initializes a new route with the http method GET.
funcNewHeadRoute¶
func NewHeadRoute(pathstring, handlerhttputils.APIFunc, opts ...RouteWrapper)Route
NewHeadRoute initializes a new route with the http method HEAD.
funcNewOptionsRoute¶
func NewOptionsRoute(pathstring, handlerhttputils.APIFunc, opts ...RouteWrapper)Route
NewOptionsRoute initializes a new route with the http method OPTIONS.
funcNewPostRoute¶
func NewPostRoute(pathstring, handlerhttputils.APIFunc, opts ...RouteWrapper)Route
NewPostRoute initializes a new route with the http method POST.
funcNewPutRoute¶
func NewPutRoute(pathstring, handlerhttputils.APIFunc, opts ...RouteWrapper)Route
NewPutRoute initializes a new route with the http method PUT.
typeRouteWrapper¶
RouteWrapper wraps a route with extra functionality.It is passed in when creating a new route.
funcWithMinimumAPIVersion¶
func WithMinimumAPIVersion(minAPIVersionstring)RouteWrapper
WithMinimumAPIVersion configures the minimum API version required fora route. It produces a 400 (Invalid Request) error when accessing theendpoint on API versions lower than "minAPIVersion".
Note that technically, it should produce a 404 ("not found") error,as the endpoint should be considered "non-existing" on such API versions,but 404 status-codes are used in business logic for various endpoints.