MCPcopy
hub / github.com/wal-g/wal-g / PushStreamToDestination

Method PushStreamToDestination

internal/stream_push_helper.go:94–103  ·  view source on GitHub ↗

TODO : unit tests PushStreamToDestination compresses a stream and push it to specifyed destination

(ctx context.Context, stream io.Reader, dstPath string)

Source from the content-addressed store, hash-verified

92// TODO : unit tests
93// PushStreamToDestination compresses a stream and push it to specifyed destination
94func (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
105func GetStreamName(backupName string, extension string) string {
106 return utility.SanitizePath(path.Join(backupName, "stream.")) + extension

Callers 1

PushStreamMethod · 0.95

Calls 5

UploadMethod · 0.95
NewWithSizeReaderFunction · 0.92
CompressAndEncryptFunction · 0.85
ConfigureCrypterFunction · 0.85
PrintlnMethod · 0.80

Tested by

no test coverage detected