當前位置: 首頁>>代碼示例>>Golang>>正文


Golang container.NewRouter函數代碼示例

本文整理匯總了Golang中github.com/docker/docker/api/server/router/container.NewRouter函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewRouter函數的具體用法?Golang NewRouter怎麽用?Golang NewRouter使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewRouter函數的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: InitRouters

// InitRouters initializes a list of routers for the server.
func (s *Server) InitRouters(d *daemon.Daemon) {
	s.addRouter(container.NewRouter(d))
	s.addRouter(local.NewRouter(d))
	s.addRouter(network.NewRouter(d))
	s.addRouter(system.NewRouter(d))
	s.addRouter(volume.NewRouter(d))
}
開發者ID:jasonamyers,項目名稱:docker,代碼行數:8,代碼來源:server.go

示例2: initRouter

func initRouter(s *apiserver.Server, d *daemon.Daemon, c *cluster.Cluster) {
	decoder := runconfig.ContainerDecoder{}

	routers := []router.Router{
		// we need to add the checkpoint router before the container router or the DELETE gets masked
		checkpointrouter.NewRouter(d, decoder),
		container.NewRouter(d, decoder),
		image.NewRouter(d, decoder),
		systemrouter.NewRouter(d, c),
		volume.NewRouter(d),
		build.NewRouter(dockerfile.NewBuildManager(d)),
		swarmrouter.NewRouter(c),
		pluginrouter.NewRouter(plugin.GetManager()),
	}

	if d.NetworkControllerEnabled() {
		routers = append(routers, network.NewRouter(d, c))
	}

	if d.HasExperimental() {
		for _, r := range routers {
			for _, route := range r.Routes() {
				if experimental, ok := route.(router.ExperimentalRoute); ok {
					experimental.Enable()
				}
			}
		}
	}

	s.InitRouter(debug.IsEnabled(), routers...)
}
開發者ID:mYmNeo,項目名稱:docker,代碼行數:31,代碼來源:daemon.go

示例3: InitRouters

// InitRouters initializes a list of routers for the server.
func (s *Server) InitRouters(d *daemon.Daemon) {
	s.addRouter(container.NewRouter(d))
	s.addRouter(image.NewRouter(d))
	s.addRouter(network.NewRouter(d))
	s.addRouter(system.NewRouter(d))
	s.addRouter(volume.NewRouter(d))
	s.addRouter(build.NewRouter(dockerfile.NewBuildManager(d)))
}
開發者ID:ajgappmark,項目名稱:docker,代碼行數:9,代碼來源:server.go

示例4: initRouters

func initRouters(s *apiserver.Server, d *daemon.Daemon) {
	s.AddRouters(container.NewRouter(d),
		image.NewRouter(d),
		network.NewRouter(d),
		systemrouter.NewRouter(d),
		volume.NewRouter(d),
		build.NewRouter(dockerfile.NewBuildManager(d)))
}
開發者ID:gao-feng,項目名稱:docker,代碼行數:8,代碼來源:daemon.go

示例5: initRouter

func initRouter(s *apiserver.Server, d *daemon.Daemon) {
	s.InitRouter(utils.IsDebugEnabled(),
		container.NewRouter(d),
		image.NewRouter(d),
		network.NewRouter(d),
		systemrouter.NewRouter(d),
		volume.NewRouter(d),
		build.NewRouter(dockerfile.NewBuildManager(d)))
}
開發者ID:fsoppelsa,項目名稱:docker,代碼行數:9,代碼來源:daemon.go

示例6: InitRouters

// InitRouters initializes a list of routers for the server.
// Sets those routers as Handler for each server.
func (s *Server) InitRouters(d *daemon.Daemon) {
	s.addRouter(local.NewRouter(d))
	s.addRouter(network.NewRouter(d))
	s.addRouter(volume.NewRouter(d))
	s.addRouter(container.NewRouter(d))

	for _, srv := range s.servers {
		srv.srv.Handler = s.CreateMux()
	}
}
開發者ID:RockaLabs,項目名稱:docker,代碼行數:12,代碼來源:server.go

示例7: initRouter

func initRouter(s *apiserver.Server, d *daemon.Daemon) {
	routers := []router.Router{
		container.NewRouter(d),
		image.NewRouter(d),
		systemrouter.NewRouter(d),
		volume.NewRouter(d),
		build.NewRouter(dockerfile.NewBuildManager(d)),
	}
	if d.NetworkControllerEnabled() {
		routers = append(routers, network.NewRouter(d))
	}

	s.InitRouter(utils.IsDebugEnabled(), routers...)
}
開發者ID:HackToday,項目名稱:docker,代碼行數:14,代碼來源:daemon.go

示例8: setAPIRoutes

func setAPIRoutes(api *apiserver.Server) {
	imageHandler := &vicbackends.Image{}
	containerHandler := vicbackends.NewContainerBackend()
	volumeHandler := &vicbackends.Volume{}
	networkHandler := &vicbackends.Network{}
	systemHandler := vicbackends.NewSystemBackend()

	api.InitRouter(false,
		image.NewRouter(imageHandler),
		container.NewRouter(containerHandler),
		volume.NewRouter(volumeHandler),
		network.NewRouter(networkHandler),
		system.NewRouter(systemHandler))
}
開發者ID:kjplatz,項目名稱:vic,代碼行數:14,代碼來源:main.go

示例9: initRouter

func initRouter(s *apiserver.Server, d *daemon.Daemon) {
	decoder := runconfig.ContainerDecoder{}

	routers := []router.Router{
		container.NewRouter(d, decoder),
		image.NewRouter(d, decoder),
		systemrouter.NewRouter(d),
		volume.NewRouter(d),
		build.NewRouter(d),
	}
	if d.NetworkControllerEnabled() {
		routers = append(routers, network.NewRouter(d))
	}

	s.InitRouter(utils.IsDebugEnabled(), routers...)
}
開發者ID:rhcarvalho,項目名稱:docker,代碼行數:16,代碼來源:daemon.go

示例10: initRouter

func initRouter(s *apiserver.Server, d *daemon.Daemon, c *cluster.Cluster) {
	decoder := runconfig.ContainerDecoder{}

	routers := []router.Router{
		container.NewRouter(d, decoder),
		image.NewRouter(d, decoder),
		systemrouter.NewRouter(d, c),
		volume.NewRouter(d),
		build.NewRouter(dockerfile.NewBuildManager(d)),
		swarmrouter.NewRouter(c),
	}
	if d.NetworkControllerEnabled() {
		routers = append(routers, network.NewRouter(d, c))
	}
	routers = addExperimentalRouters(routers)

	s.InitRouter(utils.IsDebugEnabled(), routers...)
}
開發者ID:crezam,項目名稱:docker,代碼行數:18,代碼來源:daemon.go

示例11: initRouter

func initRouter(s *apiserver.Server, d *daemon.Daemon, c *cluster.Cluster) {
	decoder := runconfig.ContainerDecoder{}

	routers := []router.Router{}

	// we need to add the checkpoint router before the container router or the DELETE gets masked
	routers = addExperimentalRouters(routers, d, decoder)

	routers = append(routers, []router.Router{
		container.NewRouter(d, decoder),
		image.NewRouter(d, decoder),
		systemrouter.NewRouter(d, c),
		volume.NewRouter(d),
		build.NewRouter(dockerfile.NewBuildManager(d)),
		swarmrouter.NewRouter(c),
	}...)

	if d.NetworkControllerEnabled() {
		routers = append(routers, network.NewRouter(d, c))
	}

	s.InitRouter(utils.IsDebugEnabled(), routers...)
}
開發者ID:kasisnu,項目名稱:docker,代碼行數:23,代碼來源:daemon.go


注:本文中的github.com/docker/docker/api/server/router/container.NewRouter函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。