(ctx context.Context, file model.Obj, args model.LinkArgs)
| 103 | } |
| 104 | |
| 105 | func (d *Alias) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) { |
| 106 | root, sub := d.getRootAndPath(file.GetPath()) |
| 107 | dsts, ok := d.pathMap[root] |
| 108 | if !ok { |
| 109 | return nil, errs.ObjectNotFound |
| 110 | } |
| 111 | for _, dst := range dsts { |
| 112 | link, err := d.link(ctx, dst, sub, args) |
| 113 | if err == nil { |
| 114 | if !args.Redirect && len(link.URL) > 0 { |
| 115 | // 正常情况下 多并发 仅支持返回URL的驱动 |
| 116 | // alias套娃alias 可以让crypt、mega等驱动(不返回URL的) 支持并发 |
| 117 | if d.DownloadConcurrency > 0 { |
| 118 | link.Concurrency = d.DownloadConcurrency |
| 119 | } |
| 120 | if d.DownloadPartSize > 0 { |
| 121 | link.PartSize = d.DownloadPartSize * utils.KB |
| 122 | } |
| 123 | } |
| 124 | return link, nil |
| 125 | } |
| 126 | } |
| 127 | return nil, errs.ObjectNotFound |
| 128 | } |
| 129 | |
| 130 | func (d *Alias) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error { |
| 131 | if !d.Writable { |
nothing calls this directly
no test coverage detected