MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / getRootAndPath

Method getRootAndPath

drivers/strm/util.go:43–53  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

41}
42
43func (d *Strm) getRootAndPath(path string) (string, string) {
44 if d.autoFlatten {
45 return d.oneKey, path
46 }
47 path = strings.TrimPrefix(path, "/")
48 parts := strings.SplitN(path, "/", 2)
49 if len(parts) == 1 {
50 return parts[0], ""
51 }
52 return parts[0], parts[1]
53}
54
55func (d *Strm) list(ctx context.Context, dst, sub string, args *fs.ListArgs) ([]model.Obj, error) {
56 reqPath := stdpath.Join(dst, sub)

Callers 2

GetMethod · 0.95
ListMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected