本文整理汇总了Golang中github.com/docker/docker/pkg/plugingetter.PluginGetter类的典型用法代码示例。如果您正苦于以下问题:Golang PluginGetter类的具体用法?Golang PluginGetter怎么用?Golang PluginGetter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginGetter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: lookupPlugin
func lookupPlugin(name, home string, opts []string, pg plugingetter.PluginGetter) (Driver, error) {
pl, err := pg.Get(name, "GraphDriver", plugingetter.LOOKUP)
if err != nil {
return nil, fmt.Errorf("Error looking up graphdriver plugin %s: %v", name, err)
}
return newPluginDriver(name, home, opts, pl.Client())
}
开发者ID:Mic92,项目名称:docker,代码行数:7,代码来源:plugin.go
示例2: validateDriver
func validateDriver(driver *api.Driver, pg plugingetter.PluginGetter, pluginType string) error {
if driver == nil {
// It is ok to not specify the driver. We will choose
// a default driver.
return nil
}
if driver.Name == "" {
return grpc.Errorf(codes.InvalidArgument, "driver name: if driver is specified name is required")
}
if strings.ToLower(driver.Name) == networkallocator.DefaultDriver || strings.ToLower(driver.Name) == ipamapi.DefaultIPAM {
return nil
}
p, err := pg.Get(driver.Name, pluginType, plugingetter.Lookup)
if err != nil {
return grpc.Errorf(codes.InvalidArgument, "error during lookup of plugin %s", driver.Name)
}
if p.IsV1() {
return grpc.Errorf(codes.InvalidArgument, "legacy plugin %s of type %s is not supported in swarm mode", driver.Name, pluginType)
}
return nil
}
开发者ID:yongtang,项目名称:swarmkit,代码行数:26,代码来源:common.go
示例3: validateAuthzPlugins
// validates that the plugins requested with the --authorization-plugin flag are valid AuthzDriver
// plugins present on the host and available to the daemon
func validateAuthzPlugins(requestedPlugins []string, pg plugingetter.PluginGetter) error {
for _, reqPlugin := range requestedPlugins {
if _, err := pg.Get(reqPlugin, authorization.AuthZApiImplements, plugingetter.LOOKUP); err != nil {
return err
}
}
return nil
}
开发者ID:mYmNeo,项目名称:docker,代码行数:10,代码来源:daemon.go
示例4: lookupPlugin
func lookupPlugin(name string, pg plugingetter.PluginGetter, config Options) (Driver, error) {
if !config.ExperimentalEnabled {
return nil, fmt.Errorf("graphdriver plugins are only supported with experimental mode")
}
pl, err := pg.Get(name, "GraphDriver", plugingetter.Acquire)
if err != nil {
return nil, fmt.Errorf("Error looking up graphdriver plugin %s: %v", name, err)
}
return newPluginDriver(name, pl, config)
}
开发者ID:docker,项目名称:docker,代码行数:10,代码来源:plugin.go
注:本文中的github.com/docker/docker/pkg/plugingetter.PluginGetter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论