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


Golang plugingetter.CompatPlugin類代碼示例

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


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

示例1: newPluginDriver

func newPluginDriver(name, home string, opts []string, pl plugingetter.CompatPlugin) (Driver, error) {
	if !pl.IsV1() {
		if p, ok := pl.(*v2.Plugin); ok {
			if p.PropagatedMount != "" {
				home = p.PluginObj.Config.PropagatedMount
			}
		}
	}
	proxy := &graphDriverProxy{name, pl}
	return proxy, proxy.Init(filepath.Join(home, name), opts)
}
開發者ID:justincormack,項目名稱:docker,代碼行數:11,代碼來源:plugin.go

示例2: newPluginDriver

func newPluginDriver(name string, pl plugingetter.CompatPlugin, config Options) (Driver, error) {
	home := config.Root
	if !pl.IsV1() {
		if p, ok := pl.(*v2.Plugin); ok {
			if p.PropagatedMount != "" {
				home = p.PluginObj.Config.PropagatedMount
			}
		}
	}
	proxy := &graphDriverProxy{name, pl}
	return proxy, proxy.Init(filepath.Join(home, name), config.DriverOptions, config.UIDMaps, config.GIDMaps)
}
開發者ID:docker,項目名稱:docker,代碼行數:12,代碼來源:plugin.go

示例3: initPlugin

// initPlugin initializes the authorization plugin if needed
func (a *authorizationPlugin) initPlugin() error {
	// Lazy loading of plugins
	var err error
	a.once.Do(func() {
		if a.plugin == nil {
			var plugin plugingetter.CompatPlugin
			var e error

			if pg := GetPluginGetter(); pg != nil {
				plugin, e = pg.Get(a.name, AuthZApiImplements, plugingetter.Lookup)
			} else {
				plugin, e = plugins.Get(a.name, AuthZApiImplements)
			}
			if e != nil {
				err = e
				return
			}
			a.plugin = plugin.Client()
		}
	})
	return err
}
開發者ID:docker,項目名稱:docker,代碼行數:23,代碼來源:plugin.go

示例4: newPluginDriver

func newPluginDriver(name, home string, opts []string, pl plugingetter.CompatPlugin) (Driver, error) {
	proxy := &graphDriverProxy{name, pl.Client(), pl}
	return proxy, proxy.Init(filepath.Join(home, name), opts)
}
開發者ID:harche,項目名稱:docker,代碼行數:4,代碼來源:plugin.go


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