artifact

package
v0.0.0-...-a644469 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRuntimePackage

func WithRuntimePackage(p *types.Package) func(o *opts)

Types

type ArtifactCache

type ArtifactCache struct {
	gofilecache.Cache
}

func NewCache

func NewCache(dir string) *ArtifactCache

func (*ArtifactCache) Get

func (c *ArtifactCache) Get(a *PackageArtifact) (string, error)

func (*ArtifactCache) Put

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

func (Checksums) List

func (c Checksums) List() (res [][]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
	LoadImage(path string) error
}

type PackageArtifact

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

	Dependencies      []*PackageArtifact              `json:"dependencies"`
	CompileSpec       *types.LuetCompilationSpec      `json:"compilationspec"`
	Checksums         Checksums                       `json:"checksums"`
	SourceAssertion   types.PackagesAssertions        `json:"-"`
	CompressionType   types.CompressionImplementation `json:"compressiontype"`
	Files             []string                        `json:"files"`
	PackageCacheImage string                          `json:"package_cacheimage"`
	Runtime           *types.Package                  `json:"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(ctx types.Context, s string, opts ...func(*PackageArtifact)) (*PackageArtifact, error)

CreateArtifactForFile creates a new artifact from the given file

func ImageToArtifact

func ImageToArtifact(ctx types.Context, img v1.Image, t types.CompressionImplementation, output string, filter func(h *tar.Header) (bool, error)) (*PackageArtifact, error)

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(ctx types.Context, imageName string, b ImageBuilder, keepPerms bool) 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(ctx types.Context) (res []string)

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(ctx types.Context, dst string, keepPerms bool, filters ...func(h *tar.Header) (bool, error)) 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, o ...func(o *opts)) error

Jump to

Keyboard shortcuts

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