MCPcopy
hub / github.com/AlistGo/alist / get

Method get

drivers/alias/util.go:57–70  ·  view source on GitHub ↗
(ctx context.Context, path string, dst, sub string)

Source from the content-addressed store, hash-verified

55}
56
57func (d *Alias) get(ctx context.Context, path string, dst, sub string) (model.Obj, error) {
58 obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true})
59 if err != nil {
60 return nil, err
61 }
62 return &model.Object{
63 Path: path,
64 Name: obj.GetName(),
65 Size: obj.GetSize(),
66 Modified: obj.ModTime(),
67 IsFolder: obj.IsDir(),
68 HashInfo: obj.GetHash(),
69 }, nil
70}
71
72func (d *Alias) list(ctx context.Context, dst, sub string, args *fs.ListArgs) ([]model.Obj, error) {
73 objs, err := fs.List(ctx, stdpath.Join(dst, sub), args)

Callers 1

GetMethod · 0.95

Calls 6

GetFunction · 0.92
GetNameMethod · 0.65
GetSizeMethod · 0.65
ModTimeMethod · 0.65
IsDirMethod · 0.65
GetHashMethod · 0.65

Tested by

no test coverage detected