TODO : unit tests PushStreamToDestination compresses a stream and push it to specifyed destination
(ctx context.Context, stream io.Reader, dstPath string)
| 92 | // TODO : unit tests |
| 93 | // PushStreamToDestination compresses a stream and push it to specifyed destination |
| 94 | func (uploader *RegularUploader) PushStreamToDestination(ctx context.Context, stream io.Reader, dstPath string) error { |
| 95 | if uploader.dataSize != nil { |
| 96 | stream = utility.NewWithSizeReader(stream, uploader.dataSize) |
| 97 | } |
| 98 | compressed := CompressAndEncrypt(stream, uploader.Compressor, ConfigureCrypter()) |
| 99 | err := uploader.Upload(ctx, dstPath, compressed) |
| 100 | tracelog.InfoLogger.Println("FILE PATH:", dstPath) |
| 101 | |
| 102 | return err |
| 103 | } |
| 104 | |
| 105 | func GetStreamName(backupName string, extension string) string { |
| 106 | return utility.SanitizePath(path.Join(backupName, "stream.")) + extension |
no test coverage detected