// ListFolders returns all folders in dir `name`.
321631
func (c *Client) ListFolders(name string) ([]os.FileInfo, error) {
	return c.ListFilter(name, func(info os.FileInfo) bool {
		return info.IsDir()
	})
}
528185
func (c *Client) ListClusters(p *ListClustersParameter) ([]*Cluster, error) {
	obj, err := c.Request("listClusters", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Cluster), err
}
299863
func (h *Heap) ListKeys() []string {
	h.lock.RLock()
	defer h.lock.RUnlock()
	list := make([]string, 0, len(h.data.items))
	for key := range h.data.items {
		list = append(list, key)
	}
	return list
}
808704
func ListSubdirs(dirPath string) ([]string, error) {
	subdirs := []string{}
	files, err := ioutil.ReadDir(dirPath)
	if err != nil {
		return nil, errors.Wrapf(err, "error reading dir %s", dirPath)
	}
	for _, f := range files {
		if f.IsDir() {
			subdirs = append(subdirs, f.Name())
		}
	}
	return subdirs, nil
}
1364254
func NewListFolderMembersArgs(SharedFolderId string) *ListFolderMembersArgs {
	s := new(ListFolderMembersArgs)
	s.SharedFolderId = SharedFolderId
	s.Limit = 1000
	return s
}
588563
func ListServices() ([]string, error) {
	fis, err := ioutil.ReadDir(InitDir)
	if err != nil {
		return nil, errors.Trace(err)
	}

	var services []string
	for _, fi := range fis {
		if groups := servicesRe.FindStringSubmatch(fi.Name()); len(groups) > 0 {
			services = append(services, groups[1])
		}
	}
	return services, nil
}
242777
func (b *BigIP) Folders() (*Folders, error) {
	var folders Folders
	err, _ := b.getForEntity(&folders, uriSys, uriFolder)
	if err != nil {
		return nil, err
	}

	return &folders, nil
}
587354
func (s *GRPCStorage) ListFiles(ctx context.Context, _ *google_protobuf.Empty) (*StringListMsg, error) {
	lst := s.backend.ListFiles()
	logrus.Debugf("found %d keys", len(lst))
	return &StringListMsg{
		FileNames: lst,
	}, nil
}
1004120
func (h HeaderMap) ListKeys() []string {
	keys := make([]string, 0, len(h))
	for k := range h {
		keys = append(keys, k)
	}
	return keys
}
1251682
func (f *Folder) findFolder(path []string) *Folder {
	if len(path) < 1 {
		return f
	}
	name := path[0]
	if next, found := f.Folders[name]; found {
		return next.findFolder(path[1:])
	}
	return nil
}
130048
func (s *DescribeFolderContentsOutput) SetFolders(v []*FolderMetadata) *DescribeFolderContentsOutput {
	s.Folders = v
	return s
}
1259173
func (c *TeeConn) ListDir(ctx context.Context, dirPath string, full bool) ([]topo.DirEntry, error) {
	return c.primary.ListDir(ctx, dirPath, full)
}
1107949
func (s *Server) ListDir(ctx context.Context, dirPath string, full bool) ([]topo.DirEntry, error) {
	nodePath := path.Join(s.root, dirPath) + "/"
	if nodePath == "//" {
		// Special case where s.root is "/", dirPath is empty,
		// we would end up with "//". in that case, we want "/".
		nodePath = "/"
	}
	resp, err := s.cli.Get(ctx, nodePath,
		clientv3.WithPrefix(),
		clientv3.WithSort(clientv3.SortByKey, clientv3.SortAscend),
		clientv3.WithKeysOnly())
	if err != nil {
		return nil, convertError(err, dirPath)
	}
	if len(resp.Kvs) == 0 {
		// No key starts with this prefix, means the directory
		// doesn't exist.
		return nil, topo.NewError(topo.NoNode, nodePath)
	}

	prefixLen := len(nodePath)
	var result []topo.DirEntry
	for _, ev := range resp.Kvs {
		p := string(ev.Key)

		// Remove the prefix, base path.
		if !strings.HasPrefix(p, nodePath) {
			return nil, ErrBadResponse
		}
		p = p[prefixLen:]

		// Keep only the part until the first '/'.
		t := topo.TypeFile
		if i := strings.Index(p, "/"); i >= 0 {
			p = p[:i]
			t = topo.TypeDirectory
		}

		// Remove duplicates, add to list.
		if len(result) == 0 || result[len(result)-1].Name != p {
			e := topo.DirEntry{
				Name: p,
			}
			if full {
				e.Type = t
				if ev.Lease != 0 {
					// Only locks have a lease associated with them.
					e.Ephemeral = true
				}
			}
			result = append(result, e)
		}
	}

	return result, nil
}
834972
func NewListFolderResult(Entries []IsMetadata, Cursor string, HasMore bool) *ListFolderResult {
	s := new(ListFolderResult)
	s.Entries = Entries
	s.Cursor = Cursor
	s.HasMore = HasMore
	return s
}
1000372
func (m *MemoryStore) ListFiles() []string {
	names := make([]string, 0, len(m.data))
	for n := range m.data {
		names = append(names, n)
	}
	return names
}
647145
func ListFiles(path string) *master.Call {
	return &master.Call{
		Type: master.Call_LIST_FILES,
		ListFiles: &master.Call_ListFiles{
			Path: path,
		},
	}
}
582731
func listPackages(dir string) (directories []string) {
	// add subdirectories
	files, err := ioutil.ReadDir(dir)
	if err != nil {
		complete.Log("failed reading directory %s: %s", dir, err)
		return
	}

	// build paths array
	paths := make([]string, 0, len(files)+1)
	for _, f := range files {
		if f.IsDir() {
			paths = append(paths, filepath.Join(dir, f.Name()))
		}
	}
	paths = append(paths, dir)

	// import packages according to given paths
	for _, p := range paths {
		pkg, err := build.ImportDir(p, 0)
		if err != nil {
			complete.Log("failed importing directory %s: %s", p, err)
			continue
		}
		directories = append(directories, pkg.Dir)
	}
	return
}