tarutil

package
v0.21.1-0...-a3b014d Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedArchiveSuffix = fmt.Errorf("archive name has an unsupported suffix")

Functions

func PopulateWithPaths

func PopulateWithPaths(tarPath string, filePaths ...string) error

PopulateWithPaths creates a compressed tar from the given paths.

Types

type Entry

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

Entry represents an entry that can be written to a tar file via a tar.Writer from the standard library.

func NewEntryFromBytes

func NewEntryFromBytes(by []byte, filename string, fileInfo os.FileInfo) Entry

func NewEntryFromFilePath

func NewEntryFromFilePath(path string) Entry

func NewEntryFromFilePaths

func NewEntryFromFilePaths(paths ...string) []Entry

type FileEntry

type FileEntry struct {
	Path string
}

type ReaderEntry

type ReaderEntry struct {
	Reader   io.Reader
	Filename string
	FileInfo os.FileInfo
}

type Writer

type Writer interface {
	WriteEntry(Entry) error
	io.Closer
}

Writer represents a facade for writing entries to a tar file.

func NewWriter

func NewWriter(archivePath string) (Writer, error)

NewWriter creates a new tar writer that writes to the specified archive path. Supports .tar.gz and .tar.zst file extensions.

Jump to

Keyboard shortcuts

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