// listModules returns the list of loaded kernel modules names parsed from
// /proc/modules.
432940
func listModules() ([]string, error) {
	fModules, err := os.Open(modulesFilepath)
	if err != nil {
		return nil, fmt.Errorf(
			"failed to open modules information at %s: %s",
			modulesFilepath, err)
	}
	defer fModules.Close()
	return parseModulesFile(fModules)
}
1294033
func (t *Tree) Modules() []*Module {
	result := make([]*Module, len(t.config.Modules))
	for i, m := range t.config.Modules {
		result[i] = &Module{
			Name:      m.Name,
			Version:   m.Version,
			Source:    m.Source,
			Providers: m.Providers,
		}
	}

	return result
}
1333079
func parseModulesFile(r io.Reader) ([]string, error) {
	var result []string

	scanner := bufio.NewScanner(r)
	scanner.Split(bufio.ScanLines)

	for scanner.Scan() {
		moduleInfoRaw := scanner.Text()
		moduleInfoSeparated := strings.Split(moduleInfoRaw, " ")
		if len(moduleInfoSeparated) < 6 {
			return nil, fmt.Errorf(
				"invalid module info - it has %d fields (less than 6): %s",
				len(moduleInfoSeparated), moduleInfoRaw)
		}

		result = append(result, moduleInfoSeparated[0])
	}

	return result, nil
}
1077121
func GetModule(name string) (Module, error) {
	driver := GetDriver()
	if driver == nil {
		return nil, errors.New("GetModule: Driver is not set")
	}

	modules := driver.GetModules()
	return modules[name], nil
}
674413
func (r *Router) Module(modules ...Module) {
	for _, m := range modules {
		r.registerModule(m)
	}
}
410111
func (c *Manager) ListTagsForCategory(ctx context.Context, id string) ([]string, error) {
	if isName(id) {
		cat, err := c.GetCategory(ctx, id)
		if err != nil {
			return nil, err
		}
		id = cat.ID
	}

	body := struct {
		ID string `json:"category_id"`
	}{id}
	url := internal.URL(c, internal.TagPath).WithID(id).WithAction("list-tags-for-category")
	var res []string
	return res, c.Do(ctx, url.Request(http.MethodPost, body), &res)
}
1349519
func (c *Config) AllModules() []*Config {
	var ret []*Config
	c.DeepEach(func(c *Config) {
		ret = append(ret, c)
	})
	return ret
}
845213
func (t Modules) Flags(usedModules ...Module) []cli.Flag {
	flags := []cli.Flag{}
	modules := t.DependOnce(usedModules...)
	for _, module := range modules {
		flags = append(flags, module.Flags...)
	}
	return flags
}
889484
func (v *Vibranium) ListContainers(ctx context.Context, opts *pb.ListContainersOptions) (*pb.Containers, error) {
	lsopts := &types.ListContainersOptions{
		Appname:    opts.Appname,
		Entrypoint: opts.Entrypoint,
		Nodename:   opts.Nodename,
	}
	containers, err := v.cluster.ListContainers(ctx, lsopts)
	if err != nil {
		return nil, err
	}

	return &pb.Containers{Containers: toRPCContainers(ctx, containers, opts.Labels)}, nil
}
33447
func LoadModule(dir string) (*tfconfig.Module, tfdiags.Diagnostics) {
	mod, diags := tfconfig.LoadModule(dir)
	return mod, wrapDiagnostics(diags)
}
197686
func (f ModuleWalkerFunc) LoadModule(req *ModuleRequest) (*Module, *version.Version, hcl.Diagnostics) {
	return f(req)
}
150686
func (s *RPCService) Modules() map[string]string {
	s.server.services.mu.Lock()
	defer s.server.services.mu.Unlock()

	modules := make(map[string]string)
	for name := range s.server.services.services {
		modules[name] = "1.0"
	}
	return modules
}
389556
func loadModules() {
	keys := []string{}
	for _, key := range Config.Options("module.") {
		keys = append(keys, key)
	}

	// Reorder module order by key name, a poor mans sort but at least it is consistent
	sort.Strings(keys)
	for _, key := range keys {
		moduleLog.Debug("Sorted keys", "keys", key)

	}
	for _, key := range keys {
		moduleImportPath := Config.StringDefault(key, "")
		if moduleImportPath == "" {
			continue
		}

		modulePath, err := ResolveImportPath(moduleImportPath)
		if err != nil {
			moduleLog.Error("Failed to load module.  Import of path failed", "modulePath", moduleImportPath, "error", err)
		}
		// Drop anything between module.???.<name of module>
		subKey := key[len("module."):]
		if index := strings.Index(subKey, "."); index > -1 {
			subKey = subKey[index+1:]
		}
		addModule(subKey, moduleImportPath, modulePath)
	}

	// Modules loaded, now show module path
	for key, callback := range appModule.initializedModules {
		if m := ModuleFromPath(key, false); m != nil {
			callback(m)
		} else {
			RevelLog.Error("Callback for non registered module initializing with application module", "modulePath", key)
			callback(appModule)
		}
	}
}
83629
func (b *BatchProvider) ListChains(table string) ([]string, error) {
	b.Lock()
	defer b.Unlock()

	return b.ipt.ListChains(table)
}
1112739
func (gce *Cloud) ListClusters() ([]string, error) {
	allClusters := []string{}

	for _, zone := range gce.managedZones {
		clusters, err := gce.listClustersInZone(zone)
		if err != nil {
			return nil, err
		}
		// TODO: Scoping?  Do we need to qualify the cluster name?
		allClusters = append(allClusters, clusters...)
	}

	return allClusters, nil
}
343220
func (db *db) ListHelmRepos(ctx context.Context) ([]*appv1.HelmRepository, error) {
	s, err := db.settingsMgr.GetSettings()
	if err != nil {
		return nil, err
	}

	repos := make([]*appv1.HelmRepository, len(s.HelmRepositories))
	for i, helmRepoInfo := range s.HelmRepositories {
		repo, err := db.getHelmRepo(ctx, helmRepoInfo.URL, s)
		if err != nil {
			return nil, err
		}
		repos[i] = repo
	}
	return repos, nil
}
1022249
func (v *GenerateServiceRequest) GetModules() (o map[ModuleID]*Module) {
	if v != nil {
		o = v.Modules
	}
	return
}