archive

package
v0.6.7-365-gf92f5b2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TarDir added in v0.5.0

func TarDir(ctx context.Context, root, prefix, out string, opts ...ArchiveOption) error

TarDir creates a tarball of a given `root` into the provided `out` path.

func TarDirWriter added in v0.5.0

func TarDirWriter(ctx context.Context, root, prefix string, tw *tar.Writer, opts ...ArchiveOption) error

TarDirWriter makes a tarball of a given `root` directory into the provided tarball writer `tw`.

func TarFile added in v0.5.0

func TarFile(ctx context.Context, src, prefix, out string, opts ...ArchiveOption) error

TarFile creates a tarball from a given `src` file to the provided `out` file.

func TarFileTo added in v0.5.0

func TarFileTo(ctx context.Context, src, dst, out string, opts ...ArchiveOption) error

TarFileTo accepts an input file `src` and places it exactly with the desired location `dst` inside the resulting artifact which is located at `out`.

func TarFileWriter added in v0.5.0

func TarFileWriter(ctx context.Context, src, dst string, tw *tar.Writer, opts ...ArchiveOption) error

TarFileWriter creates a tarball of a src to a dst using the provided tw tarball writer.

func Unarchive

func Unarchive(src, dst string, opts ...UnarchiveOption) error

Unarchive takes an input src file and determines (based on its extension)

func Untar added in v0.5.0

func Untar(src io.Reader, dst string, opts ...UnarchiveOption) error

Untar unarchives a tarball which has been gzip compressed

func UntarGz

func UntarGz(src, dst string, opts ...UnarchiveOption) error

UntarGz unarchives a tarball which has been gzip compressed

Types

type ArchiveOption added in v0.5.0

type ArchiveOption func(*ArchiveOptions) error

func WithGzip added in v0.5.0

func WithGzip(gzip bool) ArchiveOption

WithGzip indicates that when archiving occurs that the resulting artifact should be gzip compressed.

func WithStripTimes added in v0.5.0

func WithStripTimes(stripTimes bool) ArchiveOption

WithStripTimes indicates that during the archival process that any file times should be removed.

type ArchiveOptions added in v0.5.0

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

type UnarchiveOption

type UnarchiveOption func(uo *UnarchiveOptions) error

func StripComponents

func StripComponents(sc int) UnarchiveOption

type UnarchiveOptions

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

Jump to

Keyboard shortcuts

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