config

package
v1.6.3-v1.27.5-k3s1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SystemConfig is the default system configuration
	SystemConfig = system.RootPath("config.yaml")
	// LocalConfig is the local system configuration
	LocalConfig = system.LocalPath("config.yaml")
)

Functions

func NewToBool

func NewToBool() mapper.Mapper

func NewToMap

func NewToMap() mapper.Mapper

func NewToSlice

func NewToSlice() mapper.Mapper

func NewTypeConverter

func NewTypeConverter(fieldType string, converter Converter) mapper.Mapper

func PrintInstall

func PrintInstall(cfg CloudConfig) ([]byte, error)

func ToBytes

func ToBytes(cfg CloudConfig) ([]byte, error)

func ToEnv

func ToEnv(cfg CloudConfig) ([]string, error)

func Write

func Write(cfg CloudConfig, writer io.Writer) error

Types

type CloudConfig

type CloudConfig struct {
	SSHAuthorizedKeys []string   `json:"sshAuthorizedKeys,omitempty"`
	BootManifests     []Manifest `json:"bootManifests,omitempty"`
	WriteFiles        []File     `json:"writeFiles,omitempty"`
	Hostname          string     `json:"hostname,omitempty"`
	HAOS              HAOS       `json:"haos,omitempty"`
	Runcmd            []string   `json:"runCmd,omitempty"`
	Bootcmd           []string   `json:"bootCmd,omitempty"`
	Initcmd           []string   `json:"initCmd,omitempty"`
	Fs                afero.Fs   `json:"-"`
}

Builds the cloud config object

func ReadConfig

func ReadConfig() (CloudConfig, error)

func (*CloudConfig) InitFs

func (c *CloudConfig) InitFs(fs afero.Fs)

type Converter

type Converter func(val interface{}) interface{}

type File

type File struct {
	Encoding           string `json:"encoding"`
	Content            string `json:"content"`
	Owner              string `json:"owner"`
	Path               string `json:"path"`
	RawFilePermissions string `json:"permissions"`
}

func (*File) Permissions

func (f *File) Permissions() (os.FileMode, error)

type FuzzyNames

type FuzzyNames struct {
	mappers.DefaultMapper
	Names map[string]string
}

func (*FuzzyNames) AddName

func (f *FuzzyNames) AddName(name, toName string)

func (*FuzzyNames) ToInternal

func (f *FuzzyNames) ToInternal(data map[string]interface{}) error

TODO: the error is never set in this code, we don't use the return value

type HAOS

type HAOS struct {
	DataSources    []string          `json:"dataSources,omitempty"`
	Modules        []string          `json:"modules,omitempty"`
	Sysctls        map[string]string `json:"sysctls,omitempty"`
	NTPServers     []string          `json:"ntpServers,omitempty"`
	DNSNameservers []string          `json:"dnsNameservers,omitempty"`
	Wifi           []Wifi            `json:"wifi,omitempty"`
	Password       string            `json:"password,omitempty"`
	ServerURL      string            `json:"serverUrl,omitempty"`
	Token          string            `json:"token,omitempty"`
	Labels         map[string]string `json:"labels,omitempty"`
	K3sArgs        []string          `json:"k3sArgs,omitempty"`
	Environment    map[string]string `json:"environment,omitempty"`
	Taints         []string          `json:"taints,omitempty"`
	Install        *Install          `json:"install,omitempty"`
}

type Install

type Install struct {
	ForceEFI  bool   `json:"forceEfi,omitempty"`
	Device    string `json:"device,omitempty"`
	ConfigURL string `json:"configUrl,omitempty"`
	Silent    bool   `json:"silent,omitempty"`
	ISOURL    string `json:"isoUrl,omitempty"`
	PowerOff  bool   `json:"powerOff,omitempty"`
	NoFormat  bool   `json:"noFormat,omitempty"`
	Debug     bool   `json:"debug,omitempty"`
	TTY       string `json:"tty,omitempty"`
}

type Manifest

type Manifest struct {
	URL    string `json:"url"`
	SHA256 string `json:"sha256,omitempty"`
}

type Wifi

type Wifi struct {
	Name       string `json:"name,omitempty"`
	Passphrase string `json:"passphrase,omitempty"`
}

Jump to

Keyboard shortcuts

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