bbcos

package module
v0.0.0-...-c265484 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package bbcos provides a builder API for constructing Butane configs.

Index

Constants

View Source
const (
	STORAGE     = "storage"
	IGNITION    = "ignition"
	SYSTEMD     = "systemd"
	PASSWD      = "passwd"
	KERNEL_ARGS = "kernel_arguments"
	BOOT_DEVICE = "boot_device"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Booter

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

func NewBooter

func NewBooter(v *viper.Viper) *Booter

type Builder

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

Builder provides a classic builder pattern for constructing Butane configs.

func New

func New() *Builder

Create a new Butane config builder

func (*Builder) Validate

func (b *Builder) Validate() *Builder

Validate is used to validate your configuration against a particaular spec matching the set variation and version fields.

func (*Builder) ValidateWithSpec

func (b *Builder) ValidateWithSpec(spec io.Reader) *Builder

ValidateWithSpec is used to validate your configuration against a provided spec.

The spec should be a JSON schema. For help formatting your spec, please reference the out-of-box supported specs in the spec folder.

func (*Builder) Variant

func (b *Builder) Variant(v string) *Builder

Used to differentiate configs for different operating systems.

func (*Builder) Version

func (b *Builder) Version(v string) *Builder

The semantic version of the spec used for validating the constructed config.

func (*Builder) WithBootDevice

func (b *Builder) WithBootDevice(f func(*Booter)) *Builder

func (*Builder) WithIgnition

func (b *Builder) WithIgnition(f func(*Igniter)) *Builder

WithIgnition

func (*Builder) WithKernelArgs

func (b *Builder) WithKernelArgs(f func(*Kerneler)) *Builder

func (*Builder) WithPasswder

func (b *Builder) WithPasswder(f func(*Passwder)) *Builder

func (*Builder) WithStorage

func (b *Builder) WithStorage(f func(*Storager)) *Builder

WithStorage

func (*Builder) WithSystemd

func (b *Builder) WithSystemd(f func(*Systemder)) *Builder

func (*Builder) WriteTo

func (b *Builder) WriteTo(w io.Writer) (int64, error)

type Igniter

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

Igniter provides a classic builder pattern for providing metadata about the config itself.

func NewIgniter

func NewIgniter(v *viper.Viper) *Igniter

NewIgniter creates a new Ingiter.

type Kerneler

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

func NewKerneler

func NewKerneler(v *viper.Viper) *Kerneler

type Passwder

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

func NewPasswder

func NewPasswder(v *viper.Viper) *Passwder

func (*Passwder) WithUser

func (p *Passwder) WithUser(f func(*User)) *Passwder

type Storager

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

Storager provides a classic builder pattern for describing the desired state of the system’s storage devices.

func NewStorager

func NewStorager(v *viper.Viper) *Storager

NewStorager creates a new Storager.

type Systemder

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

func NewSystemder

func NewSystemder(v *viper.Viper) *Systemder

type User

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

func NewUser

func NewUser(v *viper.Viper) *User

func (*User) WithName

func (u *User) WithName(name string) *User

func (*User) WithPasswordHash

func (u *User) WithPasswordHash(hash string) *User

func (*User) WithSSHAuthorizedKeys

func (u *User) WithSSHAuthorizedKeys(keys []string) *User

Directories

Path Synopsis
cmd
specmd2json Module

Jump to

Keyboard shortcuts

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