putDirect put the file and return after finish
(ctx context.Context, dstDirPath string, file model.FileStreamer, skipHook ...bool)
| 95 | |
| 96 | // putDirect put the file and return after finish |
| 97 | func putDirectly(ctx context.Context, dstDirPath string, file model.FileStreamer, skipHook ...bool) error { |
| 98 | storage, dstDirActualPath, err := op.GetStorageAndActualPath(dstDirPath) |
| 99 | if err != nil { |
| 100 | _ = file.Close() |
| 101 | return errors.WithMessage(err, "failed get storage") |
| 102 | } |
| 103 | if storage.Config().NoUpload { |
| 104 | _ = file.Close() |
| 105 | return errors.WithStack(errs.UploadNotSupported) |
| 106 | } |
| 107 | if utils.IsBool(skipHook...) { |
| 108 | ctx = context.WithValue(ctx, conf.SkipHookKey, struct{}{}) |
| 109 | } |
| 110 | return op.Put(ctx, storage, dstDirActualPath, file, nil) |
| 111 | } |
| 112 | |
| 113 | func getDirectUploadInfo(ctx context.Context, tool, dstDirPath, dstName string, fileSize int64, overwrite bool) (any, error) { |
| 114 | storage, dstDirActualPath, err := op.GetStorageAndActualPath(dstDirPath) |
no test coverage detected