container

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupCache

func CleanupCache() error

CleanupCache removes all cached files and the cache directory

Types

type File

type File struct {
	Name    string
	IsDir   bool
	Path    string
	Size    int64
	Mode    string
	ModTime string
}

File represents a file in a layer

type Image

type Image struct {
	Reference string
	Layers    []Layer
	// contains filtered or unexported fields
}

Image represents a container image

func NewImage

func NewImage(ref string, progress ProgressFunc) (*Image, bool, error)

NewImage creates a new Image instance from a reference

func (*Image) GetConfig

func (i *Image) GetConfig() ([]byte, error)

GetConfig returns the image config

func (*Image) GetConfigWithColor

func (i *Image) GetConfigWithColor(colored bool) ([]byte, error)

GetConfigWithColor returns the image config with optional color

func (*Image) GetManifest

func (i *Image) GetManifest() ([]byte, error)

GetManifest returns the image manifest

func (*Image) GetManifestWithColor

func (i *Image) GetManifestWithColor(colored bool) ([]byte, error)

GetManifestWithColor returns the image manifest with optional color

type Layer

type Layer struct {
	DiffID  string
	Size    int64
	Command string
	// contains filtered or unexported fields
}

Layer represents an image layer

func (*Layer) GetFiles

func (l *Layer) GetFiles(path string) ([]File, error)

GetFiles returns files in the specified path

func (*Layer) InitializeLayer

func (l *Layer) InitializeLayer(progress func(float64)) error

InitializeLayer prepares the layer filesystem with progress reporting

func (*Layer) ReadFile

func (l *Layer) ReadFile(path string) ([]byte, error)

ReadFile reads the content of a file in the layer

type ProgressFunc

type ProgressFunc func(float64)

ProgressFunc is a callback function to report progress

Jump to

Keyboard shortcuts

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