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

Method extract

drivers/alias/util.go:475–492  ·  view source on GitHub ↗
(ctx context.Context, reqPath string, args model.ArchiveInnerArgs)

Source from the content-addressed store, hash-verified

473}
474
475func (d *Alias) extract(ctx context.Context, reqPath string, args model.ArchiveInnerArgs) (*model.Link, error) {
476 storage, reqActualPath, err := op.GetStorageAndActualPath(reqPath)
477 if err != nil {
478 return nil, err
479 }
480 if _, ok := storage.(driver.ArchiveReader); !ok {
481 return nil, errs.NotImplement
482 }
483 if args.Redirect && common.ShouldProxy(storage, stdpath.Base(reqPath)) {
484 _, err := fs.Get(ctx, reqPath, &fs.GetArgs{NoLog: true})
485 if err == nil {
486 return nil, err
487 }
488 return nil, nil
489 }
490 link, _, err := op.DriverExtract(ctx, storage, reqActualPath, args)
491 return link, err
492}
493
494func getAllSort(dirs []model.Obj) model.Sort {
495 ret := model.Sort{}

Callers 1

ExtractMethod · 0.95

Calls 4

GetStorageAndActualPathFunction · 0.92
ShouldProxyFunction · 0.92
GetFunction · 0.92
DriverExtractFunction · 0.92

Tested by

no test coverage detected