archive

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gzip = "gzip"
	Tar  = "tar"
	Zstd = "zstd"

	DefaultCompressionLevel = flate.DefaultCompression
	DefaultArchiveFormat    = Tar
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive interface {
	// Create writes content of the given source to an archive, returns written bytes.
	// Similar to io.WriterTo.
	Create(srcs []string, w io.Writer) (int64, error)

	// Extract reads content from the given archive reader and restores it to the destination, returns written bytes.
	// Similar to io.ReaderFrom.
	Extract(dst string, r io.Reader) (int64, error)
}

Archive is an interface that defines exposed behavior of archive formats.

func FromFormat

func FromFormat(logger log.Logger, root string, format string, opts ...Option) Archive

FromFormat determines which archive to use from given archive format.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option overrides behavior of Archive.

func WithCompressionLevel

func WithCompressionLevel(i int) Option

WithCompressionLevel sets compression level option.

func WithSkipSymlinks(b bool) Option

WithSkipSymlinks sets skip symlink option.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL