mirror of
https://github.com/moby/moby.git
synced 2026-08-05 07:30:57 +00:00
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
32 lines
736 B
Go
32 lines
736 B
Go
package 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),
|
|
}
|
|
}
|