asset

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package asset implements generation of Talos build assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootAsset

type BootAsset interface {
	Size() int64
	Reader() (io.ReadCloser, error)
}

BootAsset is an interface to access a boot asset.

It is used to abstract the access to the boot asset, so that it can be implemented in different ways, such as a local file, a remote file.

type Builder

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

Builder is the asset builder.

func NewBuilder

func NewBuilder(logger *zap.Logger, artifactsManager *artifacts.Manager, options Options) (*Builder, error)

NewBuilder creates a new asset builder.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, prof profile.Profile, versionString string) (BootAsset, error)

Build the asset.

First, check if the asset has already been built and cached then use the cached version. If the asset hasn't been built yet, build it and cache it honoring the concurrency limit, and push it to the cache.

func (*Builder) Collect

func (b *Builder) Collect(ch chan<- prometheus.Metric)

Collect implements prom.Collector interface.

func (*Builder) Describe

func (b *Builder) Describe(ch chan<- *prometheus.Desc)

Describe implements prom.Collector interface.

type Options

type Options struct {
	CacheRepository name.Repository
	CacheSigningKey crypto.PrivateKey
	RemoteOptions   []remote.Option

	AllowedConcurrency int
}

Options configures the asset builder.

Jump to

Keyboard shortcuts

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