artifact

package
v0.41.1-geaaru Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactDiffs

type ArtifactDiffs struct {
	Additions []ArtifactNode `json:"Adds"`
	Deletions []ArtifactNode `json:"Dels"`
	Changes   []ArtifactNode `json:"Mods"`
}

type ArtifactLayer

type ArtifactLayer struct {
	FromImage string        `json:"Image1"`
	ToImage   string        `json:"Image2"`
	Diffs     ArtifactDiffs `json:"Diff"`
}

type ArtifactNode

type ArtifactNode struct {
	Name string `json:"Name"`
	Size int    `json:"Size"`
}

type Checksums

type Checksums map[string]string

func (Checksums) Compare

func (c Checksums) Compare(d Checksums) error

func (*Checksums) Generate

func (c *Checksums) Generate(a *PackageArtifact) error

Generate generates all Checksums supported for the artifact

type CopyJob

type CopyJob struct {
	Src, Dst string
	Artifact string
}

type HashImplementation

type HashImplementation string
const (
	SHA256 HashImplementation = "sha256"
)

type HashOptions

type HashOptions struct {
	Hasher hash.Hash
	Type   HashImplementation
}

type ImageBuilder

type ImageBuilder interface {
	BuildImage(backend.Options) error
}

type PackageArtifact

type PackageArtifact struct {
	Path string `json:"path" yaml:"path"`

	Dependencies      []*PackageArtifact                `json:"dependencies" yaml:"dependencies"`
	CompileSpec       *compilerspec.LuetCompilationSpec `json:"compilespec" yaml:"compilespec"`
	Checksums         Checksums                         `json:"checksums" yaml:"checksums"`
	SourceAssertion   solver.PackagesAssertions         `json:"-" yaml:"-"`
	CompressionType   compression.Implementation        `json:"compressiontype" yaml:"compressiontype"`
	Files             []string                          `json:"files" yaml:"files"`
	PackageCacheImage string                            `json:"package_cacheimage" yaml:"package_cacheimage"`
	Runtime           *pkg.DefaultPackage               `json:"runtime,omitempty" yaml:"runtime,omitempty"`
}
When compiling, we write also a fingerprint.metadata.yaml file with PackageArtifact. In this way we can have another command to create the repository

which will consist in just of an repository.yaml which is just the repository structure with the list of package artifact. In this way a generic client can fetch the packages and, after unpacking the tree, performing queries to install packages.

func CreateArtifactForFile

func CreateArtifactForFile(s string, opts ...func(*PackageArtifact)) (*PackageArtifact, error)

CreateArtifactForFile creates a new artifact from the given file

func ExtractArtifactFromDelta

func ExtractArtifactFromDelta(src, dst string, layers []ArtifactLayer, concurrency int, keepPerms bool, includes []string, excludes []string, t compression.Implementation) (*PackageArtifact, error)

ExtractArtifactFromDelta extracts deltas from ArtifactLayer from an image in tar format

func NewPackageArtifact

func NewPackageArtifact(path string) *PackageArtifact

func NewPackageArtifactFromYaml

func NewPackageArtifactFromYaml(data []byte) (*PackageArtifact, error)

func (*PackageArtifact) Compress

func (a *PackageArtifact) Compress(src string, concurrency int) error

Compress is responsible to archive and compress to the artifact Path. It accepts a source path, which is the content to be archived/compressed and a concurrency parameter.

func (*PackageArtifact) FileList

func (a *PackageArtifact) FileList() ([]string, error)

FileList generates the list of file of a package from the local archive

func (*PackageArtifact) GenerateFinalImage

func (a *PackageArtifact) GenerateFinalImage(imageName string, b ImageBuilder, keepPerms bool) (backend.Options, error)

GenerateFinalImage takes an artifact and builds a Docker image with its content

func (*PackageArtifact) GetFileName

func (a *PackageArtifact) GetFileName() string

func (*PackageArtifact) GetProtectFiles

func (a *PackageArtifact) GetProtectFiles() []string

func (*PackageArtifact) GetSubsets

func (a *PackageArtifact) GetSubsets() *LuetSubsetsDefinition

func (*PackageArtifact) GetTarFormersSpec

func (a *PackageArtifact) GetTarFormersSpec(enableSubsets bool) *tarf_specs.SpecFile

func (*PackageArtifact) GetUncompressedName

func (a *PackageArtifact) GetUncompressedName() string

GetUncompressedName returns the artifact path without the extension suffix

func (*PackageArtifact) Hash

func (a *PackageArtifact) Hash() error

func (*PackageArtifact) ShallowCopy

func (p *PackageArtifact) ShallowCopy() *PackageArtifact

func (*PackageArtifact) Unpack

func (a *PackageArtifact) Unpack(dst string, enableSubsets bool) error

Unpack Untar and decompress (TODO) to the given path

func (*PackageArtifact) Verify

func (a *PackageArtifact) Verify() error

func (*PackageArtifact) WriteYaml

func (a *PackageArtifact) WriteYaml(dst string) error

Jump to

Keyboard shortcuts

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