unpack

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtrdSockEnv = "CONTAINERD_SOCK"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory

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

func NewDirectoryUnpacker

func NewDirectoryUnpacker(s *sys.System, path string, opts ...DirectoryOpt) *Directory

func (Directory) SynchedUnpack

func (d Directory) SynchedUnpack(ctx context.Context, destination string, excludes []string, deleteExcludes []string) (string, error)

func (Directory) Unpack

func (d Directory) Unpack(ctx context.Context, destination string, excludes ...string) (string, error)

type DirectoryOpt

type DirectoryOpt func(*Directory)

func WithRsyncFlagsDir

func WithRsyncFlagsDir(flags ...string) DirectoryOpt

type Interface

type Interface interface {
	// Unpack extracts the contents to the provided destination. It allows to exclude
	// certain given paths. All exclude paths are assumed to be tied to source root
	Unpack(ctx context.Context, destination string, excludes ...string) (string, error)

	// SynchedUnpack extracts the contents to the provided destination ensuring origin and
	// destination are perfectly synched, that is any preexisting content in destination which
	// is not part of the original image source will be deleted. In addition, it allows to exclude
	// paths from the synchronization.
	SynchedUnpack(ctx context.Context, destination string, excludes []string, deleteExcludes []string) (string, error)
}

func NewUnpacker

func NewUnpacker(s *sys.System, src *deployment.ImageSource, opts ...Opt) (Interface, error)

type OCI

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

func NewOCIUnpacker

func NewOCIUnpacker(s *sys.System, imageRef string, opts ...OCIOpt) *OCI

func (OCI) SynchedUnpack

func (o OCI) SynchedUnpack(ctx context.Context, destination string, excludes []string, deleteExcludes []string) (digest string, err error)

func (OCI) Unpack

func (o OCI) Unpack(ctx context.Context, destination string, excludes ...string) (digest string, err error)

type OCIOpt

type OCIOpt func(*OCI)

func WithContainerd

func WithContainerd(ctrd containerd.Interface) OCIOpt

func WithLocalOCI

func WithLocalOCI(local bool) OCIOpt

func WithPlatformRefOCI

func WithPlatformRefOCI(platform string) OCIOpt

func WithRsyncFlagsOCI

func WithRsyncFlagsOCI(flags ...string) OCIOpt

func WithVerifyOCI

func WithVerifyOCI(verify bool) OCIOpt

type Opt

type Opt func(deployment.ImageSrcType, *options)

func WithLocal

func WithLocal(local bool) Opt

func WithPlatformRef

func WithPlatformRef(platform string) Opt

func WithRsyncFlags

func WithRsyncFlags(flags ...string) Opt

func WithVerify

func WithVerify(verify bool) Opt

type Raw

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

func NewRawUnpacker

func NewRawUnpacker(s *sys.System, path string, opts ...RawOpt) *Raw

func (Raw) SynchedUnpack

func (r Raw) SynchedUnpack(ctx context.Context, destination string, excludes []string, deleteExcludes []string) (digest string, err error)

func (Raw) Unpack

func (r Raw) Unpack(ctx context.Context, destination string, excludes ...string) (digest string, err error)

type RawOpt

type RawOpt func(*Raw)

func WithRsyncFlagsRaw

func WithRsyncFlagsRaw(flags ...string) RawOpt

type Tar

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

func NewTarUnpacker

func NewTarUnpacker(s *sys.System, tarball string, opts ...TarOpt) *Tar

func (Tar) SynchedUnpack

func (t Tar) SynchedUnpack(ctx context.Context, destination string, excludes []string, deleteExcludes []string) (digest string, err error)

SynchedUnpack for tarball files will extract tar contents to a destination sibling directory first and after that it will sync it to the destination directory. Ideally the destination path should not be mountpoint to a different filesystem of the sibling directories in order to benefit of copy on write features of the base filesystem.

func (Tar) Unpack

func (t Tar) Unpack(ctx context.Context, destination string, excludes ...string) (string, error)

type TarOpt

type TarOpt func(*Tar)

func WithRsyncFlagsTar

func WithRsyncFlagsTar(flags ...string) TarOpt

Jump to

Keyboard shortcuts

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