MCPcopy Create free account
hub / github.com/devld/go-drive / List

Method List

drive/script/index.go:178–193  ·  view source on GitHub ↗
(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

176}
177
178func (sd *ScriptDrive) List(ctx context.Context, path string) ([]types.IEntry, error) {
179 vm, e := sd.pool.Get(ctx)
180 if e != nil {
181 return nil, e
182 }
183 defer func() { _ = sd.pool.Return(context.Background(), vm) }()
184 v, e := sd.call(ctx, vm, "list", s.NewContext(vm, ctx), path)
185 if e != nil {
186 return nil, e
187 }
188 arr := v.Array()
189 if arr == nil {
190 panic("invalid value got from drive")
191 }
192 return utils.ArrayMap(arr, func(t **s.Value) types.IEntry { return sd.valueToEntry(*t) }), nil
193}
194
195func (sd *ScriptDrive) Delete(ctx types.TaskCtx, path string) error {
196 vm, e := sd.pool.Get(ctx)

Callers

nothing calls this directly

Calls 6

callMethod · 0.95
valueToEntryMethod · 0.95
ArrayMapFunction · 0.92
ReturnMethod · 0.80
ArrayMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected