2018-02-05 16:05:59 -05:00
|
|
|
package router // import "github.com/docker/docker/api/server/router"
|
2015-09-23 19:42:08 -04:00
|
|
|
|
2015-09-25 06:19:17 -04:00
|
|
|
import "github.com/docker/docker/api/server/httputils"
|
2015-09-23 19:42:08 -04:00
|
|
|
|
2015-12-30 12:20:41 -05:00
|
|
|
// Router defines an interface to specify a group of routes to add to the docker server.
|
2015-09-23 19:42:08 -04:00
|
|
|
type Router interface {
|
2015-12-30 12:20:41 -05:00
|
|
|
// Routes returns the list of routes to add to the docker server.
|
2015-09-23 19:42:08 -04:00
|
|
|
Routes() []Route
|
|
|
|
}
|
|
|
|
|
|
|
|
// Route defines an individual API route in the docker server.
|
|
|
|
type Route interface {
|
|
|
|
// Handler returns the raw function to create the http handler.
|
|
|
|
Handler() httputils.APIFunc
|
2015-09-25 06:19:17 -04:00
|
|
|
// Method returns the http method that the route responds to.
|
|
|
|
Method() string
|
|
|
|
// Path returns the subpath where the route responds to.
|
|
|
|
Path() string
|
2015-09-23 19:42:08 -04:00
|
|
|
}
|