artifact

package
v0.34.1-geaaru Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: GPL-3.0 Imports: 35 Imported by: 1

Documentation

Overview

Copyright © 2022 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2022 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

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 ArtifactsMap

type ArtifactsMap struct {
	Artifacts map[string][]*PackageArtifact `json:"artifacts" yaml:"artifacts"`
}

func NewArtifactsMap

func NewArtifactsMap() *ArtifactsMap

func (*ArtifactsMap) Add

func (am *ArtifactsMap) Add(p *PackageArtifact)

func (*ArtifactsMap) GetArtifactsByKey

func (am *ArtifactsMap) GetArtifactsByKey(k string) ([]*PackageArtifact, error)

func (*ArtifactsMap) GetKeyFromValue

func (am *ArtifactsMap) GetKeyFromValue(p *PackageArtifact) string

func (*ArtifactsMap) GetProvides

func (am *ArtifactsMap) GetProvides(p string) []*PackageArtifact

func (*ArtifactsMap) GetSortedArtifactsByKey

func (am *ArtifactsMap) GetSortedArtifactsByKey(k string) ([]*PackageArtifact, error)

func (*ArtifactsMap) HasKey

func (am *ArtifactsMap) HasKey(k string) bool

func (*ArtifactsMap) MatchVersion

func (am *ArtifactsMap) MatchVersion(p *PackageArtifact) (*PackageArtifact, error)

func (*ArtifactsMap) ToList

func (am *ArtifactsMap) ToList() *[]*PackageArtifact

type ArtifactsPack

type ArtifactsPack struct {
	Artifacts []*PackageArtifact `json:"artifacts" yaml:"artifacts"`
}

func NewArtifactsPack

func NewArtifactsPack() *ArtifactsPack

func (*ArtifactsPack) IsPresent

func (ap *ArtifactsPack) IsPresent(p *PackageArtifact) bool

func (*ArtifactsPack) ToMap

func (ap *ArtifactsPack) ToMap() *ArtifactsMap

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"`
	CachePath string `json:"cache_path,omitempty" yaml:"cache_path,omitempty"`

	Dependencies      []*PackageArtifact                `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
	CompileSpec       *compilerspec.LuetCompilationSpec `json:"compilespec,omitempty" yaml:"compilespec,omitempty"`
	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,omitempty" yaml:"package_cacheimage,omitempty"`
	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 NewPackageArtifactFromJson

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

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) GetPackage

func (a *PackageArtifact) GetPackage() *pkg.DefaultPackage

func (*PackageArtifact) GetPackageTreePath

func (a *PackageArtifact) GetPackageTreePath(treefs string) string

func (*PackageArtifact) GetProtectFiles

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

func (*PackageArtifact) GetRepository

func (a *PackageArtifact) GetRepository() 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) GetVersion

func (a *PackageArtifact) GetVersion() string

func (*PackageArtifact) Hash

func (a *PackageArtifact) Hash() error

func (*PackageArtifact) ResolveCachePath

func (a *PackageArtifact) ResolveCachePath()

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) WriteMetadataJson

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

func (*PackageArtifact) WriteMetadataYaml

func (a *PackageArtifact) WriteMetadataYaml(dst string) 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