config

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 17 Imported by: 3

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 added in v0.3.0

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"`
	WriteFiles        []File   `json:"writeFiles,omitempty"`
	Hostname          string   `json:"hostname,omitempty"`
	K3OS              K3OS     `json:"k3os,omitempty"`
	Runcmd            []string `json:"runCmd,omitempty"`
	Bootcmd           []string `json:"bootCmd,omitempty"`
	Initcmd           []string `json:"initCmd,omitempty"`
}

func ReadConfig

func ReadConfig() (CloudConfig, error)

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
	// contains filtered or unexported fields
}

func (*FuzzyNames) ModifySchema

func (f *FuzzyNames) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error

func (*FuzzyNames) ToInternal

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

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 K3OS

type K3OS 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 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