Documentation ¶
Index ¶
- func WithRuntimePackage(p *types.Package) func(o *opts)
- type ArtifactCache
- type Checksums
- type HashImplementation
- type HashOptions
- type ImageBuilder
- type PackageArtifact
- func CreateArtifactForFile(ctx types.Context, s string, opts ...func(*PackageArtifact)) (*PackageArtifact, error)
- func ImageToArtifact(ctx types.Context, img v1.Image, t types.CompressionImplementation, ...) (*PackageArtifact, error)
- func NewPackageArtifact(path string) *PackageArtifact
- func NewPackageArtifactFromYaml(data []byte) (*PackageArtifact, error)
- func (a *PackageArtifact) Compress(src string, concurrency int) error
- func (a *PackageArtifact) FileList() ([]string, error)
- func (a *PackageArtifact) GenerateFinalImage(ctx types.Context, imageName string, b ImageBuilder, keepPerms bool) error
- func (a *PackageArtifact) GetFileName() string
- func (a *PackageArtifact) GetProtectFiles(ctx types.Context) (res []string)
- func (a *PackageArtifact) GetUncompressedName() string
- func (a *PackageArtifact) Hash() error
- func (p *PackageArtifact) ShallowCopy() *PackageArtifact
- func (a *PackageArtifact) Unpack(ctx types.Context, dst string, keepPerms bool, ...) error
- func (a *PackageArtifact) Verify() error
- func (a *PackageArtifact) WriteYAML(dst string, o ...func(o *opts)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRuntimePackage ¶
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 ¶
func (c *ArtifactCache) Put(a *PackageArtifact) (gofilecache.OutputID, int64, error)
type Checksums ¶
func (*Checksums) Generate ¶
func (c *Checksums) Generate(a *PackageArtifact) error
Generate generates all Checksums supported for the artifact
type HashImplementation ¶
type HashImplementation string
const (
SHA256 HashImplementation = "sha256"
)
type HashOptions ¶
type HashOptions struct { Hasher hash.Hash Type HashImplementation }
type ImageBuilder ¶
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 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