layers

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract added in v0.9.0

func Extract(r io.Reader, dest string) error

Extract extracts entries from r to the dest directory Contents of r should be an OCI layer. If dest is an empty string files with be extracted to `/` or `c:\` on unix and windows filesystems respectively.

Types

type Factory

type Factory struct {
	ArtifactsDir string // ArtifactsDir is the directory where layer files are written
	UID, GID     int    // UID and GID are used to normalize layer entries
	Logger       log.Logger
	// contains filtered or unexported fields
}

func (*Factory) DirLayer

func (f *Factory) DirLayer(id string, dir string) (layer Layer, err error)

DirLayer creates a layer from the given directory DirLayer will set the UID and GID of entries describing dir and its children (but not its parents)

to Factory.UID and Factory.GID

func (*Factory) LauncherLayer added in v0.9.0

func (f *Factory) LauncherLayer(path string) (layer Layer, err error)

LauncherLayer creates a Layer containing the launcher at path

func (*Factory) ProcessTypesLayer added in v0.9.0

func (f *Factory) ProcessTypesLayer(config launch.Metadata) (layer Layer, err error)

ProcessTypesLayer creates a Layer containing symlinks pointing to target where:

  • any parents of the symlink files will also be added to the layer
  • symlinks and their parent directories shall be root owned and world readable

func (*Factory) SliceLayers

func (f *Factory) SliceLayers(dir string, slices []Slice) ([]Layer, error)

SliceLayers divides dir into layers using slices using the following process: * Given n slices SliceLayers will return n+1 layers * The first n layers will contain files matched by the any Path in the nth Slice * The final layer will contain any files in dir that were not included in a previous layer Some layers may be empty

type Layer

type Layer struct {
	ID      string
	TarPath string
	Digest  string
}

type Slice

type Slice struct {
	Paths []string `toml:"paths"`
}

Jump to

Keyboard shortcuts

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