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

Method List

drivers/strm/driver.go:175–194  ·  view source on GitHub ↗
(ctx context.Context, dir model.Obj, args model.ListArgs)

Source from the content-addressed store, hash-verified

173}
174
175func (d *Strm) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
176 path := dir.GetPath()
177 if utils.PathEqual(path, "/") && !d.autoFlatten {
178 return d.listRoot(), nil
179 }
180 root, sub := d.getRootAndPath(path)
181 dsts, ok := d.pathMap[root]
182 if !ok {
183 return nil, errs.ObjectNotFound
184 }
185 var objs []model.Obj
186 fsArgs := &fs.ListArgs{NoLog: true, Refresh: args.Refresh}
187 for _, dst := range dsts {
188 tmp, err := d.list(ctx, dst, sub, fsArgs)
189 if err == nil {
190 objs = append(objs, tmp...)
191 }
192 }
193 return objs, nil
194}
195
196func (d *Strm) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
197 if file.GetID() == "strm" {

Callers

nothing calls this directly

Calls 5

listRootMethod · 0.95
getRootAndPathMethod · 0.95
listMethod · 0.95
PathEqualFunction · 0.92
GetPathMethod · 0.65

Tested by

no test coverage detected