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

Function DecryptBytes

internal/fetch_helper.go:84–99  ·  view source on GitHub ↗
(archiveReader io.Reader)

Source from the content-addressed store, hash-verified

82}
83
84func DecryptBytes(archiveReader io.Reader) (io.Reader, error) {
85 crypter := ConfigureCrypter()
86 if crypter == nil {
87 tracelog.DebugLogger.Printf("No crypter has been selected")
88 return archiveReader, nil
89 }
90
91 tracelog.DebugLogger.Printf("Selected crypter: %s", crypter.Name())
92
93 decryptReader, err := crypter.Decrypt(archiveReader)
94 if err != nil {
95 return nil, fmt.Errorf("failed to init decrypt reader: %w", err)
96 }
97
98 return decryptReader, nil
99}
100
101// CachedDecompressor is the file extension describing decompressor
102type CachedDecompressor struct {

Callers 3

collectCopyingInfoFunction · 0.92
downloadObjectFunction · 0.92
DecompressDecryptBytesFunction · 0.85

Calls 4

ConfigureCrypterFunction · 0.85
ErrorfMethod · 0.80
NameMethod · 0.65
DecryptMethod · 0.65

Tested by

no test coverage detected