// GetPluginInfo returns plugin info
497958
func (f *IdentityClient) GetPluginInfo(ctx context.Context, in *csipb.GetPluginInfoRequest, opts ...grpc.CallOption) (*csipb.GetPluginInfoResponse, error) {
	return nil, nil
}
170760
func GetPluginsInstallDir(pluginName string) (string, error) {
	pluginInstallPrefixes, err := GetPluginInstallPrefixes()
	if err != nil {
		return "", err
	}

	for _, prefix := range pluginInstallPrefixes {
		if SubDirectoryExists(prefix, pluginName) {
			return prefix, nil
		}
	}
	return "", fmt.Errorf("Plugin '%s' not installed on following locations : %s", pluginName, pluginInstallPrefixes)
}
690490
func ForPlugin(name string) PluginLogger {
	if logger, found := DefaultRegistry.Lookup(name); found {
		DefaultLogger.Debugf("using plugin logger for %q that was already initialized", name)
		return &ParentLogger{
			Logger:  logger,
			Prefix:  name,
			Factory: DefaultRegistry,
		}
	}
	return NewParentLogger(name, DefaultRegistry)
}
22678
func (actor Actor) GetPluginInfoFromRepositoriesForPlatform(pluginName string, pluginRepos []configv3.PluginRepository, platform string) (PluginInfo, []string, error) {
	var reposWithPlugin []string
	var newestPluginInfo PluginInfo
	var pluginFoundWithIncompatibleBinary bool

	for _, repo := range pluginRepos {
		pluginInfo, err := actor.getPluginInfoFromRepositoryForPlatform(pluginName, repo, platform)
		switch err.(type) {
		case actionerror.PluginNotFoundInRepositoryError:
			continue
		case actionerror.NoCompatibleBinaryError:
			pluginFoundWithIncompatibleBinary = true
			continue
		case nil:
			if len(reposWithPlugin) == 0 || lessThan(newestPluginInfo.Version, pluginInfo.Version) {
				newestPluginInfo = pluginInfo
				reposWithPlugin = []string{repo.Name}
			} else if pluginInfo.Version == newestPluginInfo.Version {
				reposWithPlugin = append(reposWithPlugin, repo.Name)
			}
		default:
			return PluginInfo{}, nil, actionerror.FetchingPluginInfoFromRepositoryError{
				RepositoryName: repo.Name,
				Err:            err,
			}
		}
	}

	if len(reposWithPlugin) == 0 {
		if pluginFoundWithIncompatibleBinary {
			return PluginInfo{}, nil, actionerror.NoCompatibleBinaryError{}
		}
		return PluginInfo{}, nil, actionerror.PluginNotFoundInAnyRepositoryError{PluginName: pluginName}
	}
	return newestPluginInfo, reposWithPlugin, nil
}
272770
func (renderer *Renderer) GetInfo() (RendererInfo, error) {
	var cinfo cRendererInfo
	var info RendererInfo
	ret := int(C.SDL_GetRendererInfo(renderer.cptr(), cinfo.cptr()))
	if ret < 0 {
		return info, GetError()
	}
	info.RendererInfoData = cinfo.RendererInfoData
	// No need to free, it's done by DestroyRenderer
	info.Name = C.GoString(cinfo.Name)
	return info, nil
}
1053605
func (obj *GenericObject) GetInfo(ctx context.Context) (*NxInfo, error) {
	result := &struct {
		Info *NxInfo	`json:"qInfo"`
	} {}
	err := obj.rpc(ctx, "GetInfo", result)
	return result.Info, err 
}
1042818
func GetVersionInfo(ctx context.Context, pluginPath string, exec Exec) (version.PluginInfo, error) {
	if exec == nil {
		exec = defaultExec
	}
	args := &Args{
		Command: "VERSION",

		// set fake values required by plugins built against an older version of skel
		NetNS:  "dummy",
		IfName: "dummy",
		Path:   "dummy",
	}
	stdin := []byte(fmt.Sprintf(`{"cniVersion":%q}`, version.Current()))
	stdoutBytes, err := exec.ExecPlugin(ctx, pluginPath, stdin, args.AsEnv())
	if err != nil {
		if err.Error() == "unknown CNI_COMMAND: VERSION" {
			return version.PluginSupports("0.1.0"), nil
		}
		return nil, err
	}

	return exec.Decode(stdoutBytes)
}
887289
func GetAll(imp string) ([]*Plugin, error) {
	pluginNames, err := Scan()
	if err != nil {
		return nil, err
	}

	type plLoad struct {
		pl  *Plugin
		err error
	}

	chPl := make(chan *plLoad, len(pluginNames))
	var wg sync.WaitGroup
	for _, name := range pluginNames {
		storage.Lock()
		pl, ok := storage.plugins[name]
		storage.Unlock()
		if ok {
			chPl <- &plLoad{pl, nil}
			continue
		}

		wg.Add(1)
		go func(name string) {
			defer wg.Done()
			pl, err := loadWithRetry(name, false)
			chPl <- &plLoad{pl, err}
		}(name)
	}

	wg.Wait()
	close(chPl)

	var out []*Plugin
	for pl := range chPl {
		if pl.err != nil {
			logrus.Error(pl.err)
			continue
		}
		if err := pl.pl.waitActive(); err == nil && pl.pl.implements(imp) {
			out = append(out, pl.pl)
		}
	}
	return out, nil
}
600653
func GetGaugePluginVersion(pluginName string) (string, error) {
	pluginProperties, err := GetPluginProperties(fmt.Sprintf("%s.json", pluginName))
	if err != nil {
		return "", fmt.Errorf("Failed to get gauge %s properties file. %s", pluginName, err)
	}
	return pluginProperties["version"].(string), nil
}
682131
func (d dynamicSystemView) LookupPlugin(ctx context.Context, name string, pluginType consts.PluginType) (*pluginutil.PluginRunner, error) {
	if d.core == nil {
		return nil, fmt.Errorf("system view core is nil")
	}
	if d.core.pluginCatalog == nil {
		return nil, fmt.Errorf("system view core plugin catalog is nil")
	}
	r, err := d.core.pluginCatalog.Get(ctx, name, pluginType)
	if err != nil {
		return nil, err
	}
	if r == nil {
		return nil, errwrap.Wrapf(fmt.Sprintf("{{err}}: %s", name), ErrPluginNotFound)
	}

	return r, nil
}
625849
func (s *RemoteServer) GetPluginVersions(ctx context.Context, name string) ([]string, error) {
	// TODO (m0sth8): add sort by -version and increase limit
	plugins, err := s.api.Plugins.List(ctx, &client.PluginsListOpts{Name: name})
	if err != nil {
		return nil, err
	}
	versions := []string{}
	for _, pl := range plugins.Results {
		versions = append(versions, pl.Version)
	}
	return versions, nil
}
1272175
func (h *Helper) GetRegionsInfo() (*RegionsInfo, error) {
	etcd, ok := h.Store.(tikv.EtcdBackend)
	if !ok {
		return nil, errors.WithStack(errors.New("not implemented"))
	}
	pdHosts := etcd.EtcdAddrs()
	if len(pdHosts) == 0 {
		return nil, errors.New("pd unavailable")
	}
	req, err := http.NewRequest("GET", protocol+pdHosts[0]+pdapi.Regions, nil)
	if err != nil {
		return nil, errors.Trace(err)
	}
	timeout, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
	resp, err := http.DefaultClient.Do(req.WithContext(timeout))
	defer cancelFunc()
	if err != nil {
		return nil, errors.Trace(err)
	}
	defer func() {
		err = resp.Body.Close()
		if err != nil {
			logutil.Logger(context.Background()).Error("close body failed", zap.Error(err))
		}
	}()
	var regionsInfo RegionsInfo
	err = json.NewDecoder(resp.Body).Decode(&regionsInfo)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &regionsInfo, nil
}
403965
func IsPluginInstalled(name, version string) bool {
	pluginsDir, err := GetPluginsInstallDir(name)
	if err != nil {
		return false
	}
	return DirExists(filepath.Join(pluginsDir, name, version))
}
1365294
func GetGaugeHomeDirectory() (string, error) {
	customPluginRoot := os.Getenv(GaugeHome)
	if customPluginRoot != "" {
		return customPluginRoot, nil
	}
	if isWindows() {
		appDataDir := os.Getenv(appData)
		if appDataDir == "" {
			return "", fmt.Errorf("Failed to find plugin installation path. Could not get APPDATA")
		}
		return filepath.Join(appDataDir, ProductName), nil
	}
	userHome := getUserHomeFromEnv()
	return filepath.Join(userHome, DotGauge), nil
}
733670
func findPlugins() []string {
	re := regexp.MustCompile(JujuPluginPattern)
	path := os.Getenv("PATH")
	plugins := []string{}
	for _, name := range filepath.SplitList(path) {
		entries, err := ioutil.ReadDir(name)
		if err != nil {
			continue
		}
		for _, entry := range entries {
			if re.Match([]byte(entry.Name())) && (entry.Mode()&0111) != 0 {
				plugins = append(plugins, entry.Name())
			}
		}
	}
	sort.Strings(plugins)
	return plugins
}
231916
func GetAdmissionPluginConfigurationFor(pluginCfg apiserver.AdmissionPluginConfiguration) (io.Reader, error) {
	// if there is a nest object, return it directly
	if pluginCfg.Configuration != nil {
		return bytes.NewBuffer(pluginCfg.Configuration.Raw), nil
	}
	// there is nothing nested, so we delegate to path
	if pluginCfg.Path != "" {
		content, err := ioutil.ReadFile(pluginCfg.Path)
		if err != nil {
			klog.Fatalf("Couldn't open admission plugin configuration %s: %#v", pluginCfg.Path, err)
			return nil, err
		}
		return bytes.NewBuffer(content), nil
	}
	// there is no special config at all
	return nil, nil
}
1245611
func (c *Client) GetPlugin(typ, name string, ver int) *GetPluginResult {
	r := &GetPluginResult{}

	path := "/plugins/" + typ + "/" + name + "/" + strconv.Itoa(ver)

	resp, err := c.do("GET", path, ContentTypeJSON)
	if err != nil {
		r.Err = err
		return r
	}

	switch resp.Meta.Type {
	// TODO change this to concrete const type when Joel adds it
	case rbody.PluginReturnedType:
		// Success
		b := resp.Body.(*rbody.PluginReturned)
		r.ReturnedPlugin = ReturnedPlugin{b}
		return r
	case rbody.ErrorType:
		r.Err = resp.Body.(*rbody.Error)
	default:
		r.Err = ErrAPIResponseMetaType
	}
	return r
}