layout

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigMediaType = types.MediaType("application/online.jarosik.tomasz.v1.config+json")

Variables

This section is empty.

Functions

func DirectoryDiskUsage

func DirectoryDiskUsage(path string) (string, error)

DirectoryDiskUsage returns the disk usage of the specified directory.

func IsDirWithOnlyFiles

func IsDirWithOnlyFiles(path string) (bool, error)

IsDirWithOnlyFiles checks if the given path is a directory that contains only files (no subdirectories).

Types

type ImmutableStatistics added in v0.6.0

type ImmutableStatistics struct {
	SourceBytesCount     int64
	BytesWrittenCount    int64
	BytesSkippedCount    int64
	BytesReadCount       int64
	BytesClonedCount     int64
	CompressedBytesCount int64
	MatchedSegmentsCount int64
}

ImmutableStatistics holds the immutable copy of statistics

type Layout

type Layout struct {
	Filenames []string
	Digests   map[string][]v1.Hash
	Sizes     []int64
}

type Mapper

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

func NewMapper

func NewMapper(rootDir string, opts ...dirimage.Option) *Mapper

func (*Mapper) Adopt

func (lm *Mapper) Adopt(src string, ref name.Reference, failIfContainsSubdirectories bool) error

func (*Mapper) Clone

func (lm *Mapper) Clone(src name.Reference, dst name.Reference) error

func (*Mapper) ContainsAny

func (lm *Mapper) ContainsAny(ref name.Reference) (bool, error)

ContainsAny returns true if there is a directory corresponding to the provided reference It does not validate if that directory contains anything useful

func (*Mapper) ContainsManifest

func (lm *Mapper) ContainsManifest(ref name.Reference) bool

func (*Mapper) List

func (lm *Mapper) List() ([]Properties, error)

func (*Mapper) Read

func (lm *Mapper) Read(ctx context.Context, ref name.Reference) (v1.Image, error)

func (*Mapper) ReadDigest added in v0.6.1

func (lm *Mapper) ReadDigest(ref name.Reference) (v1.Hash, error)

func (*Mapper) ReadManifest added in v0.6.1

func (lm *Mapper) ReadManifest(ref name.Reference) (*v1.Manifest, error)

func (*Mapper) Remove

func (lm *Mapper) Remove(src name.Reference) error

func (*Mapper) Stats

func (lm *Mapper) Stats() ImmutableStatistics

func (*Mapper) Write

func (lm *Mapper) Write(ctx context.Context, img v1.Image, ref name.Reference) error

func (*Mapper) WriteIfNotPresent added in v0.6.1

func (lm *Mapper) WriteIfNotPresent(ctx context.Context, img v1.Image, ref name.Reference) error

type MountableImage

type MountableImage struct {
	v1.Image

	Reference name.Reference
}

func NewMountableImage

func NewMountableImage(image v1.Image, ref name.Reference) *MountableImage

func (*MountableImage) ConfigLayer

func (mi *MountableImage) ConfigLayer() (v1.Layer, error)

func (*MountableImage) LayerByDiffID

func (mi *MountableImage) LayerByDiffID(d v1.Hash) (v1.Layer, error)

func (*MountableImage) LayerByDigest

func (mi *MountableImage) LayerByDigest(d v1.Hash) (v1.Layer, error)

func (*MountableImage) Layers

func (mi *MountableImage) Layers() ([]v1.Layer, error)

type Properties

type Properties struct {
	Ref         name.Reference
	DiskUsage   string
	Size        int64
	HasManifest bool
}

type Statistics

type Statistics struct {
	SourceBytesCount     atomic.Int64
	BytesWrittenCount    atomic.Int64
	BytesSkippedCount    atomic.Int64
	BytesReadCount       atomic.Int64
	BytesClonedCount     atomic.Int64
	CompressedBytesCount atomic.Int64
	MatchedSegmentsCount atomic.Int64
}

func (*Statistics) Add

func (s *Statistics) Add(other *Statistics)

func (*Statistics) Clear

func (s *Statistics) Clear()

func (*Statistics) String added in v0.6.0

func (s *Statistics) String() string

String formats the Statistics struct for human-readable output

Jump to

Keyboard shortcuts

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