Documentation
¶
Index ¶
- Constants
- func EncodeCloudInit(name string, object any) (string, error)
- func EncodeObject(name string, object any) (string, error)
- func GeneratePublicKey(authKey string) (publicKey string, err error)
- func ToCIDR(address, netmask string) string
- type CloudInit
- func (c CloudInit) AddDirectoryToWriteFile(srcDir, dstDir, owner string) error
- func (c CloudInit) AddFileToWriteFile(sourceFile, dstDir, owner string) error
- func (c CloudInit) AddObjectToWriteFile(object any, destination, owner string, permissions uint) error
- func (c CloudInit) AddRunCommand(command ...string) (err error)
- func (c CloudInit) AddTextToWriteFile(text string, destination, owner string, permissions uint)
- func (c CloudInit) AddToWriteFile(content []byte, destination, owner string, permissions uint)
- func (c CloudInit) Clone() (copy CloudInit, err error)
- type CloudInitInput
- type GuestInfos
- type Nameserver
- type NetworkAdapter
- type NetworkConfig
- type NetworkDeclare
- type NetworkResolv
Constants ¶
View Source
const GzipBase64 = "gzip+base64"
Variables ¶
This section is empty.
Functions ¶
func GeneratePublicKey ¶
Types ¶
type CloudInit ¶
func (CloudInit) AddDirectoryToWriteFile ¶
func (CloudInit) AddFileToWriteFile ¶
func (CloudInit) AddObjectToWriteFile ¶
func (CloudInit) AddRunCommand ¶
func (CloudInit) AddTextToWriteFile ¶
func (CloudInit) AddToWriteFile ¶
type CloudInitInput ¶
type CloudInitInput struct { InstanceName string InstanceID string //string(uuid.NewUUID()) DomainName string UserName string AuthKey string TimeZone string Network *NetworkDeclare AllowUpgrade bool CloudInit CloudInit }
func (*CloudInitInput) BuildGuestInfos ¶
func (input *CloudInitInput) BuildGuestInfos() (GuestInfos, error)
func (*CloudInitInput) BuildUserData ¶
func (input *CloudInitInput) BuildUserData(netplan string) (vendorData CloudInit, err error)
func (*CloudInitInput) BuildVendorData ¶
func (input *CloudInitInput) BuildVendorData() CloudInit
type GuestInfos ¶
GuestInfos the guest infos Must not start with `guestinfo.`
func (GuestInfos) IsEmpty ¶
func (g GuestInfos) IsEmpty() bool
type Nameserver ¶
type Nameserver struct { Search []string `json:"search,omitempty" yaml:"search,omitempty"` Addresses []string `json:"addresses,omitempty" yaml:"addresses,omitempty"` }
Nameserver declaration
type NetworkAdapter ¶
type NetworkAdapter struct { DHCP4 bool `json:"dhcp4,omitempty" yaml:"dhcp4,omitempty"` NicName *string `json:"set-name,omitempty" yaml:"set-name,omitempty"` Match *map[string]string `json:"match,omitempty" yaml:"match,omitempty"` Addresses *[]any `json:"addresses,omitempty" yaml:"addresses,omitempty"` Nameservers *Nameserver `json:"nameservers,omitempty" yaml:"nameservers,omitempty"` DHCPOverrides CloudInit `json:"dhcp4-overrides,omitempty" yaml:"dhcp4-overrides,omitempty"` Routes *[]v1alpha2.NetworkRoutes `json:"routes,omitempty" yaml:"routes,omitempty"` }
NetworkAdapter wrapper
type NetworkConfig ¶
type NetworkConfig struct { InstanceID string `json:"instance-id,omitempty" yaml:"instance-id,omitempty"` LocalHostname string `json:"local-hostname,omitempty" yaml:"local-hostname,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` Network *NetworkDeclare `json:"network,omitempty" yaml:"network,omitempty"` }
NetworkConfig wrapper
type NetworkDeclare ¶
type NetworkDeclare struct { Version int `default:"2" json:"version,omitempty" yaml:"version,omitempty"` Ethernets map[string]*NetworkAdapter `json:"ethernets,omitempty" yaml:"ethernets,omitempty"` }
NetworkDeclare wrapper
type NetworkResolv ¶
type NetworkResolv struct { Search []string `json:"search,omitempty" yaml:"search,omitempty"` Nameserver []string `json:"nameserver,omitempty" yaml:"nameserver,omitempty"` }
NetworkResolv /etc/resolv.conf
Click to show internal directories.
Click to hide internal directories.