config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT 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 BhojpurOS

type BhojpurOS 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"`
	DcpArgs        []string          `json:"dcpArgs,omitempty"`
	Environment    map[string]string `json:"environment,omitempty"`
	Taints         []string          `json:"taints,omitempty"`
	Install        *Install          `json:"install,omitempty"`
}

type CloudConfig

type CloudConfig struct {
	SSHAuthorizedKeys []string  `json:"sshAuthorizedKeys,omitempty"`
	WriteFiles        []File    `json:"writeFiles,omitempty"`
	Hostname          string    `json:"hostname,omitempty"`
	BhojpurOS         BhojpurOS `json:"bos,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 Wifi

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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