archive

package
v3.127.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListArchive

func ListArchive(ctx context.Context, zipFile *os.File, zipFileLen int64) ([]string, error)

func ResolveHomeDir

func ResolveHomeDir(path string) (string, error)

Types

type ArchiveInfo

type ArchiveInfo struct {
	ArchivePath    string
	Sha256sum      string
	Size           int64
	WrittenBytes   int64
	WrittenEntries int64
	Duration       time.Duration
}

func BuildArchive

func BuildArchive(ctx context.Context, paths []string, key string) (*ArchiveInfo, error)

func ExtractFiles

func ExtractFiles(ctx context.Context, zipFile *os.File, zipFileLen int64, paths []string) (*ArchiveInfo, error)

type ChecksumSHA256

type ChecksumSHA256 struct {
	// contains filtered or unexported fields
}

func NewChecksumSHA256

func NewChecksumSHA256(f io.Writer) *ChecksumSHA256

func (*ChecksumSHA256) Sum

func (c *ChecksumSHA256) Sum() string

func (*ChecksumSHA256) Write

func (c *ChecksumSHA256) Write(p []byte) (n int, err error)

implement the io.WriteCloser interface

type Mapping

type Mapping struct {
	Path         string
	ResolvedPath string
	RelativePath string
	Chroot       string
	Relative     bool
}

Mapping represents a mapping of a file path to a destination path, including the chroot path and whether the path is relative or not.

func PathsToMappings

func PathsToMappings(paths []string) ([]Mapping, error)

PathsToMappings takes a slice of file paths and returns a slice of Mapping structs, which contain information about the destination path, chroot path, and whether the path is relative or not. It handles paths starting with "~/" by replacing them with the user's home directory.

Jump to

Keyboard shortcuts

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