Documentation ¶
Index ¶
- Variables
- func IsConfigurationLoaded() bool
- func LoadConfiguration(options *Options) error
- type Configuration
- func (configuration *Configuration) GetBaseImage() *bi.Configuration
- func (configuration *Configuration) GetBasePackages() []string
- func (configuration *Configuration) GetCloudInit() *ci.Configuration
- func (configuration *Configuration) GetDownloader() *downloader.Configuration
- func (configuration *Configuration) GetExtraPackages() []string
- func (configuration *Configuration) GetLogLevel() string
- func (configuration *Configuration) GetQemu() *qemu.Configuration
- func (configuration *Configuration) GetRepositories() []*repositories.Configuration
- func (configuration *Configuration) GetUnattendedUpgrades() *uu.Configuration
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( // ChangeChannel is the channel that is used to notify the application that the configuration has changed. ChangeChannel = make(chan bool) )
Functions ¶
func IsConfigurationLoaded ¶
func IsConfigurationLoaded() bool
IsConfigurationLoaded returns true if the configuration is loaded.
func LoadConfiguration ¶
LoadConfiguration loads the configuration from the given options.
Types ¶
type Configuration ¶
type Configuration struct { // BaseImage is a reference to the BaseImage configuration. BaseImage *bi.Configuration `json:"base_image" yaml:"base_image" toml:"base_image" mapstructure:"base_image"` // CloudInit is a reference to the CloudInit configuration. CloudInit *ci.Configuration `json:"cloud_init" yaml:"cloud_init" toml:"cloud_init" mapstructure:"cloud_init"` // Downloader is a reference to the Downloader configuration. Downloader *downloader.Configuration `json:"downloader" yaml:"downloader" toml:"downloader" mapstructure:"downloader"` // Qemu is a reference to the Qemu configuration. Qemu *qemu.Configuration `json:"qemu" yaml:"qemu" toml:"qemu" mapstructure:"qemu"` // Repositories is a list of repositories that will be added to the base image. Repositories []*repositories.Configuration `json:"repositories" yaml:"repositories" toml:"repositories" mapstructure:"repositories"` // UnattendedUpgrades is a reference to the UnattendedUpgrades configuration. UnattendedUpgrades *uu.Configuration `json:"unattended_upgrades" yaml:"unattended_upgrades" toml:"unattended_upgrades" mapstructure:"unattended_upgrades"` // BasePackages is a list of packages that will be installed in the base image. BasePackages []string `json:"base_packages" yaml:"base_packages" toml:"base_packages" mapstructure:"base_packages"` // ExtraPackages is a list of user specified packages that will be installed in the base image. ExtraPackages []string `json:"extra_packages" yaml:"extra_packages" toml:"extra_packages" mapstructure:"extra_packages"` // LogLevel is the log level for the application. LogLevel string `json:"log_level" yaml:"log_level" toml:"log_level" mapstructure:"log_level"` }
Configuration is the configuration for the application.
func GetConfiguration ¶
func GetConfiguration() *Configuration
GetConfiguration returns the configuration for the application.
func (*Configuration) GetBaseImage ¶
func (configuration *Configuration) GetBaseImage() *bi.Configuration
GetBaseImage returns the BaseImage configuration.
func (*Configuration) GetBasePackages ¶
func (configuration *Configuration) GetBasePackages() []string
GetBasePackages returns the list of packages that will be installed in the base image.
func (*Configuration) GetCloudInit ¶
func (configuration *Configuration) GetCloudInit() *ci.Configuration
GetCloudInit returns the CloudInit configuration.
func (*Configuration) GetDownloader ¶
func (configuration *Configuration) GetDownloader() *downloader.Configuration
GetDownloader returns the Downloader configuration.
func (*Configuration) GetExtraPackages ¶
func (configuration *Configuration) GetExtraPackages() []string
GetExtraPackages returns the list of user specified packages that will be installed in the base image.
func (*Configuration) GetLogLevel ¶
func (configuration *Configuration) GetLogLevel() string
GetLogLevel returns the log level for the application.
func (*Configuration) GetQemu ¶
func (configuration *Configuration) GetQemu() *qemu.Configuration
GetQemu returns the Qemu configuration.
func (*Configuration) GetRepositories ¶
func (configuration *Configuration) GetRepositories() []*repositories.Configuration
GetRepositories returns the list of repositories that will be added to the base image.
func (*Configuration) GetUnattendedUpgrades ¶
func (configuration *Configuration) GetUnattendedUpgrades() *uu.Configuration
GetUnattendedUpgrades returns the UnattendedUpgrades configuration.
type Options ¶
type Options struct { // Name is the name of the configuration file. Name string // Path is the path to the configuration file. Path string // Extension is the extension of the configuration file. Extension string }
Options is a struct that holds the configuration options for the application.
func NewCustomOptions ¶
NewCustomOptions creates a new Options struct with custom values.
func NewDefaultOptions ¶
func NewDefaultOptions() *Options
NewDefaultOptions creates a new Options struct with default values.
func NewOptions ¶
NewOptions creates a new Options struct.
func (*Options) GetExtension ¶
GetExtension returns the extension of the configuration file.