mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
32 lines
804 B
Go
32 lines
804 B
Go
package distribution // import "github.com/docker/docker/api/server/router/distribution"
|
|
|
|
import "github.com/docker/docker/api/server/router"
|
|
|
|
// distributionRouter is a router to talk with the registry
|
|
type distributionRouter struct {
|
|
backend Backend
|
|
routes []router.Route
|
|
}
|
|
|
|
// NewRouter initializes a new distribution router
|
|
func NewRouter(backend Backend) router.Router {
|
|
r := &distributionRouter{
|
|
backend: backend,
|
|
}
|
|
r.initRoutes()
|
|
return r
|
|
}
|
|
|
|
// Routes returns the available routes
|
|
func (dr *distributionRouter) Routes() []router.Route {
|
|
return dr.routes
|
|
}
|
|
|
|
// initRoutes initializes the routes in the distribution router
|
|
func (dr *distributionRouter) initRoutes() {
|
|
dr.routes = []router.Route{
|
|
// GET
|
|
router.NewGetRoute("/distribution/{name:.*}/json", dr.getDistributionInfo),
|
|
}
|
|
}
|