// InstalledPluginList ...
8117
func InstalledPluginList() ([]Plugin, error) {
	routing, err := readPluginRouting()
	if err != nil {
		return []Plugin{}, err
	}

	pluginList := []Plugin{}

	for name := range routing.RouteMap {
		if plugin, found, err := LoadPlugin(name); err != nil {
			return []Plugin{}, err
		} else if !found {
			return []Plugin{}, fmt.Errorf("Plugin (%s) found in route, but could not load it", name)
		} else {
			pluginList = append(pluginList, plugin)
		}
	}

	return pluginList, nil
}
851842
func (ps *Store) GetAllManagedPluginsByCap(capability string) []plugingetter.CompatPlugin {
	return ps.getAllByCap(capability)
}
705552
func ListPlugins() map[string][]string {
	p := make(map[string][]string)

	// server type plugins
	for name := range serverTypes {
		p["server_types"] = append(p["server_types"], name)
	}

	// caddyfile loaders in registration order
	for _, loader := range caddyfileLoaders {
		p["caddyfile_loaders"] = append(p["caddyfile_loaders"], loader.name)
	}
	if defaultCaddyfileLoader.name != "" {
		p["caddyfile_loaders"] = append(p["caddyfile_loaders"], defaultCaddyfileLoader.name)
	}

	// List the event hook plugins
	eventHooks.Range(func(k, _ interface{}) bool {
		p["event_hooks"] = append(p["event_hooks"], k.(string))
		return true
	})

	// alphabetize the rest of the plugins
	var others []string
	for stype, stypePlugins := range plugins {
		for name := range stypePlugins {
			var s string
			if stype != "" {
				s = stype + "."
			}
			s += name
			others = append(others, s)
		}
	}

	sort.Strings(others)
	for _, name := range others {
		p["others"] = append(p["others"], name)
	}

	return p
}
226161
func (s *Service) BuildpackInstallationList(ctx context.Context, appIdentity string, lr *ListRange) (BuildpackInstallationListResult, error) {
	var buildpackInstallation BuildpackInstallationListResult
	return buildpackInstallation, s.Get(ctx, &buildpackInstallation, fmt.Sprintf("/apps/%v/buildpack-installations", appIdentity), nil, lr)
}
150359
func (s *Server) registerPlugin(p plugins.Plugin) {
	s.pluginMtx.Lock()
	defer s.pluginMtx.Unlock()
	s.plugins = append(s.plugins, p)
}
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
}
796544
func computePluginNames(explicitlyEnabled []string, all []string) (enabled []string, disabled []string) {
	return explicitlyEnabled, sets.NewString(all...).Difference(sets.NewString(explicitlyEnabled...)).List()
}
381932
func GetPluginInstallPrefixes() ([]string, error) {
	primaryPluginInstallDir, err := GetPrimaryPluginsInstallDir()
	if err != nil {
		return nil, err
	}
	return []string{primaryPluginInstallDir}, nil
}
1364602
func (pm *PluginManager) loadPlugins() error {
	files, err := ioutil.ReadDir(pm.cfg.Dir)
	if err != nil {
		return err
	}

	// Make sure all the files were going to load
	// are indeed compiled shared libs of plugins
	for _, file := range files {
		if strings.HasSuffix(file.Name(), ".so") {
			err = pm.loadPlugin(pm.cfg.Dir, file.Name())
			if err != nil {
				return err
			}
		}
	}

	return nil
}
411554
func (a *authorizationPlugin) initPlugin() error {
	// Lazy loading of plugins
	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)
				a.SetName(plugin.Name())
			} else {
				plugin, e = plugins.Get(a.name, AuthZApiImplements)
			}
			if e != nil {
				a.initErr = e
				return
			}
			a.plugin = plugin.Client()
		}
	})
	return a.initErr
}
479188
func GetPrimaryPluginsInstallDir() (string, error) {
	gaugeHome, err := GetGaugeHomeDirectory()
	if err != nil {
		return "", err
	}
	return filepath.Join(gaugeHome, Plugins), nil
}
1350133
func (s *ServerRPC) ServiceList(ctx context.Context, req *types.ServiceListRequest) (*types.ServiceListResponse, error) {
	services, err := s.daemon.GetServices(req.PodID)
	if err != nil {
		return nil, err
	}

	return &types.ServiceListResponse{
		Services: services,
	}, nil
}
1008261
func (s *ServerRPC) ContainerList(ctx context.Context, req *types.ContainerListRequest) (*types.ContainerListResponse, error) {
	containerList, err := s.daemon.ListContainers(req.PodID, req.VmID)
	if err != nil {
		return nil, err
	}

	return &types.ContainerListResponse{
		ContainerList: containerList,
	}, nil
}
914318
func (pm *Manager) List(pluginFilters filters.Args) ([]types.Plugin, error) {
	return nil, errNotSupported
}
466832
func pluginsListAction(ctx *cli.Context, api *client.Client, timeout cmd.Timeout) {
	plugins, err := api.Plugins.List(timeout(), nil)
	if err != nil {
		fmt.Printf("%s", err)
		os.Exit(1)
	}
	fmt.Printf("Found %d plugins:\n", plugins.Count)
	for _, p := range plugins.Results {
		fmt.Println(p)
	}
}
852957
func (ts float32Slice) PackList(buf BufferEx) (int, error) {
	size := 0
	for _, elem := range ts {
		n, err := PackFloat32(buf, elem)
		size += n
		if err != nil {
			return size, err
		}
	}
	return size, nil
}
508867
func (m *MockCommonAPIClient) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) {
	ret := m.ctrl.Call(m, "PluginList", ctx, filter)
	ret0, _ := ret[0].(types.PluginsListResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}