asset

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MPL-2.0 Imports: 18 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, cache cache.Cache, options Options) (*Builder, error)

NewBuilder creates a new asset builder.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, prof profile.Profile, versionString, filename, filenameOverride 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 {
	MetricsNamespace   string
	AllowedConcurrency int
	GetAfterPut        bool
}

Options configures the asset builder.

Directories

Path Synopsis
Package cache provides an interface for caching boot assets.
Package cache provides an interface for caching boot assets.
cdn
Package cdn implements a cache wrapper for boot assets, rewriting URLs to go through CDN.
Package cdn implements a cache wrapper for boot assets, rewriting URLs to go through CDN.
registry
Package registry implements a cache using an OCI registry.
Package registry implements a cache using an OCI registry.
s3
Package s3 implements a cache for boot assets using S3-compatible storage.
Package s3 implements a cache for boot assets using S3-compatible storage.

Jump to

Keyboard shortcuts

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