(ctx context.Context, file model.Obj, args model.LinkArgs)
| 57 | } |
| 58 | |
| 59 | func (d *SFTP) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) { |
| 60 | if err := d.clientReconnectOnConnectionError(); err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | remoteFile, err := d.client.Open(file.GetPath()) |
| 64 | if err != nil { |
| 65 | return nil, err |
| 66 | } |
| 67 | mFile := &stream.RateLimitFile{ |
| 68 | File: remoteFile, |
| 69 | Limiter: stream.ServerDownloadLimit, |
| 70 | Ctx: ctx, |
| 71 | } |
| 72 | return &model.Link{ |
| 73 | RangeReader: stream.GetRangeReaderFromMFile(file.GetSize(), mFile), |
| 74 | SyncClosers: utils.NewSyncClosers(remoteFile), |
| 75 | RequireReference: true, |
| 76 | }, nil |
| 77 | } |
| 78 | |
| 79 | func (d *SFTP) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error { |
| 80 | if err := d.clientReconnectOnConnectionError(); err != nil { |
nothing calls this directly
no test coverage detected