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


Golang Engine.Hack_SetGlobalVar方法代碼示例

本文整理匯總了Golang中github.com/dockercn/docker/engine.Engine.Hack_SetGlobalVar方法的典型用法代碼示例。如果您正苦於以下問題:Golang Engine.Hack_SetGlobalVar方法的具體用法?Golang Engine.Hack_SetGlobalVar怎麽用?Golang Engine.Hack_SetGlobalVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/dockercn/docker/engine.Engine的用法示例。


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

示例1: Install

// Install installs daemon capabilities to eng.
func (daemon *Daemon) Install(eng *engine.Engine) error {
	// FIXME: rename "delete" to "rm" for consistency with the CLI command
	// FIXME: rename ContainerDestroy to ContainerRm for consistency with the CLI command
	// FIXME: remove ImageDelete's dependency on Daemon, then move to graph/
	for name, method := range map[string]engine.Handler{
		"attach":            daemon.ContainerAttach,
		"build":             daemon.CmdBuild,
		"commit":            daemon.ContainerCommit,
		"container_changes": daemon.ContainerChanges,
		"container_copy":    daemon.ContainerCopy,
		"container_inspect": daemon.ContainerInspect,
		"containers":        daemon.Containers,
		"create":            daemon.ContainerCreate,
		"delete":            daemon.ContainerDestroy,
		"export":            daemon.ContainerExport,
		"info":              daemon.CmdInfo,
		"kill":              daemon.ContainerKill,
		"logs":              daemon.ContainerLogs,
		"pause":             daemon.ContainerPause,
		"resize":            daemon.ContainerResize,
		"restart":           daemon.ContainerRestart,
		"start":             daemon.ContainerStart,
		"stop":              daemon.ContainerStop,
		"top":               daemon.ContainerTop,
		"unpause":           daemon.ContainerUnpause,
		"wait":              daemon.ContainerWait,
		"image_delete":      daemon.ImageDelete, // FIXME: see above
	} {
		if err := eng.Register(name, method); err != nil {
			return err
		}
	}
	if err := daemon.Repositories().Install(eng); err != nil {
		return err
	}
	// FIXME: this hack is necessary for legacy integration tests to access
	// the daemon object.
	eng.Hack_SetGlobalVar("httpapi.daemon", daemon)
	return nil
}
開發者ID:beginnor,項目名稱:docker,代碼行數:41,代碼來源:daemon.go


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