model

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package model defines the contracts shared by the bootstrap subsystem: a machine configuration that can be validated, installed and uninstalled, and the providers and groups that organise them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapErrors

func WrapErrors(err error, errs []error) error

WrapErrors wraps err with each of errs in turn, so the last element of errs ends up outermost: WrapErrors(base, [a, b]) reads "b: a: base". Every wrapped error stays reachable through errors.Is and errors.As.

Types

type IMachineConfiguration

type IMachineConfiguration interface {
	// Name is a short human-readable label for the configuration.
	Name() string
	// Validate reports whether the configuration is already in place. A
	// non-nil error means it is not (and Install may be able to fix it).
	Validate(ctx context.Context) (out *bytes.Buffer, err error)
	// Install puts the configuration in place. It must be idempotent.
	Install(ctx context.Context) (out *bytes.Buffer, err error)
	// Uninstall removes the configuration where that is safe to automate.
	Uninstall(ctx context.Context) (out *bytes.Buffer, err error)
}

IMachineConfiguration is one piece of workstation state that allbctl knows how to inspect and manage (a directory, a tool, a dotfiles clone...).

Every method returns a non-nil buffer holding human-readable output, even when it also returns an error. The context bounds any external command or network call the implementation makes.

type IMachineConfigurationProvider

type IMachineConfigurationProvider interface {
	GetConfiguration() []IMachineConfiguration
}

IMachineConfigurationProvider supplies the ordered list of configurations that make up a bootstrapped workstation for one operating system.

type MachineConfigurationGroup

type MachineConfigurationGroup struct {
	GroupName string
	Configs   []IMachineConfiguration
}

MachineConfigurationGroup is a named, ordered collection of configurations that is itself a configuration, so groups can be nested and reported on as one section.

func (MachineConfigurationGroup) Install

Install installs every member that does not already validate. Members that validate are reported as-is and left untouched.

func (MachineConfigurationGroup) Name

Name returns the group's name.

func (MachineConfigurationGroup) Uninstall

Uninstall uninstalls every member in reverse order.

func (MachineConfigurationGroup) Validate

Validate validates every member and concatenates their output. It returns an error naming the group when any member is not in place, or when the group is empty.

Jump to

Keyboard shortcuts

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