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 ¶
- func WrapErrors(err error, errs []error) error
- type IMachineConfiguration
- type IMachineConfigurationProvider
- type MachineConfigurationGroup
- func (m MachineConfigurationGroup) Install(ctx context.Context) (*bytes.Buffer, error)
- func (m MachineConfigurationGroup) Name() string
- func (m MachineConfigurationGroup) Uninstall(ctx context.Context) (*bytes.Buffer, error)
- func (m MachineConfigurationGroup) Validate(ctx context.Context) (*bytes.Buffer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapErrors ¶
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 ¶
func (m MachineConfigurationGroup) Name() string
Name returns the group's name.