src/server/pkg/hashtree/db.go
func List(rs []io.ReadCloser, pattern string, f func(string, *NodeProto) error) (retErr error) {
	pattern = clean(pattern)
	if pattern == "" {
		pattern = "/"
	}
	g, err := globlib.Compile(pattern, '/')
	if err != nil {
		return errorf(MalformedGlob, err.Error())
	}
	return nodes(rs, func(path string, node *NodeProto) error {
		if (g.Match(path) && node.DirNode == nil) || (g.Match(pathlib.Dir(path))) {
			return f(path, node)
		}
		return nil
	})
}
func List(rs []io.ReadCloser, pattern string, f func(string, *NodeProto) error) (retErr error) {
	pattern = clean(pattern)
	if pattern == "" {
		pattern = "/"
	}
	g, err := globlib.Compile(pattern, '/')
	if err != nil {
		return errorf(MalformedGlob, err.Error())
	}
	return nodes(rs, func(path string, node *NodeProto) error {
		if (g.Match(path) && node.DirNode == nil) || (g.Match(pathlib.Dir(path))) {
			return f(path, node)
		}
		return nil
	})
}
// List executes a callback for each file under a directory (or a file if the path is a file).