Documentation
¶
Overview ¶
Package archive identifies backup files from their contents.
Index ¶
Constants ¶
const (
// SniffSize is how many bytes SniffBytes needs to recognise a format.
SniffSize = 8 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func Decompress ¶
Decompress returns a reader for gzip or zstd data. Damaged data is reported while reading.
func PlainDumpTruncated ¶
PlainDumpTruncated reports whether a pg_dump plain file lost its end. psql exits successfully on such a file, because it can't tell a short file from a finished one. Only pg_dump's own output has the footer, so SQL files without its header are never reported.
Types ¶
type Format ¶
type Format string
Format is the kind of file a backup turned out to be.
const ( FormatEmpty Format = "empty" FormatUnknown Format = "unknown" FormatCustom Format = "custom" FormatPlain Format = "plain" FormatGzip Format = "gzip" FormatZstd Format = "zstd" FormatAge Format = "age" FormatPGP Format = "pgp" )
Formats the runner can recognise.
func Sniff ¶
Sniff detects the format from the first bytes of r, because file extensions can't be trusted.
func SniffBytes ¶
SniffBytes detects the format from the first bytes of a file.