talos
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5// Package overlay provides an interface for overlay installers.
6package overlay7
8// Installer is an interface for overlay installers.
9type Installer[T any] interface {10GetOptions(extra T) (Options, error)11Install(options InstallOptions[T]) error12}
13
14// Options for the overlay installer.
15type Options struct {16Name string `yaml:"name"`17KernelArgs []string `yaml:"kernelArgs,omitempty"`18PartitionOptions PartitionOptions `yaml:"partitionOptions,omitempty"`19}
20
21// PartitionOptions for the overlay installer.
22type PartitionOptions struct {23Offset uint64 `yaml:"offset,omitempty"`24}
25
26// InstallOptions for the overlay installer.
27type InstallOptions[T any] struct {28InstallDisk string `yaml:"installDisk"`29MountPrefix string `yaml:"mountPrefix"`30ArtifactsPath string `yaml:"artifactsPath"`31ExtraOptions T `yaml:"extraOptions,omitempty"`32}
33
34// ExtraOptions for the overlay installer.
35type ExtraOptions map[string]any36