Documentation
¶
Overview ¶
Package config parses flags and returns a configuration for imaging a usb
Index ¶
- Variables
- type Configuration
- func (c *Configuration) Cleanup() bool
- func (c *Configuration) ConfFile() string
- func (c *Configuration) Devices() []string
- func (c *Configuration) Distro() string
- func (c *Configuration) DistroLabel() string
- func (c *Configuration) Elevated() bool
- func (c *Configuration) FFU() bool
- func (c *Configuration) FileName() string
- func (c *Configuration) Image() string
- func (c *Configuration) ImageFile() string
- func (c *Configuration) Path() string
- func (c *Configuration) PowerOff() bool
- func (c *Configuration) SFUDest() string
- func (c *Configuration) SFUManifest() string
- func (c *Configuration) SFUPath() string
- func (c *Configuration) SeedDest() string
- func (c *Configuration) SeedFile() string
- func (c *Configuration) SeedServer() string
- func (c *Configuration) String() string
- func (c *Configuration) Track() string
- func (c *Configuration) UpdateDevices(newDevices []string)
- func (c *Configuration) UpdateOnly() bool
- func (c *Configuration) Warning() bool
- type OperatingSystem
Constants ¶
This section is empty.
Variables ¶
var ( // IsElevatedCmd injects the command to determine the elevation state of the // user context. IsElevatedCmd = isRoot )
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration represents the state of all flags and selections provided by the user when the binary is invoked.
func New ¶
func New(cleanup, warning, eject, ffu, update bool, devices []string, os, track, seedServer string) (*Configuration, error)
New generates a new configuration from flags passed on the command line. It performs sanity checks on those parameters.
func (*Configuration) Cleanup ¶
func (c *Configuration) Cleanup() bool
Cleanup returns whether or not the cleanup of temp files was requested by flag.
func (*Configuration) ConfFile ¶
func (c *Configuration) ConfFile() string
ConfFile returns the final name of the configuration file.
func (*Configuration) Devices ¶
func (c *Configuration) Devices() []string
Devices returns the devices to be provisioned.
func (*Configuration) Distro ¶
func (c *Configuration) Distro() string
Distro returns the name of the selected distribution, or blank if none has been selected.
func (*Configuration) DistroLabel ¶
func (c *Configuration) DistroLabel() string
DistroLabel returns the label that should be used for media provisioned with the selected distribution. Can be empty.
func (*Configuration) Elevated ¶
func (c *Configuration) Elevated() bool
Elevated identifies if the user is running the binary with elevated permissions.
func (*Configuration) FFU ¶
func (c *Configuration) FFU() bool
FFU returns whether or not to place the SFU files after provisioning.
func (*Configuration) FileName ¶
func (c *Configuration) FileName() string
FileName returns the name of the config file.
func (*Configuration) Image ¶
func (c *Configuration) Image() string
Image returns the full path to the raw image for this configuration.
func (*Configuration) ImageFile ¶
func (c *Configuration) ImageFile() string
ImageFile returns the filename of the raw image for this configuration.
func (*Configuration) Path ¶
func (c *Configuration) Path() string
Path returns the path to the config.
func (*Configuration) PowerOff ¶
func (c *Configuration) PowerOff() bool
PowerOff returns whether or not devices should be powered off after write operations.
func (*Configuration) SFUDest ¶
func (c *Configuration) SFUDest() string
SFUDest returns the relative path where the SFU files should be written.
func (*Configuration) SFUManifest ¶
func (c *Configuration) SFUManifest() string
SFUManifest returns the filename of the SFU manifest file for this configuration.
func (*Configuration) SFUPath ¶
func (c *Configuration) SFUPath() string
SFUPath returns the path to the SFU manifest.
func (*Configuration) SeedDest ¶
func (c *Configuration) SeedDest() string
SeedDest returns the relative path where a seed should be written.
func (*Configuration) SeedFile ¶
func (c *Configuration) SeedFile() string
SeedFile returns the path to the file that is to be hashed when obtaining a seed.
func (*Configuration) SeedServer ¶
func (c *Configuration) SeedServer() string
SeedServer returns the configured seed server for the chosen distribution.
func (*Configuration) String ¶
func (c *Configuration) String() string
String implements the fmt.Stringer interface. This allows config to be passed to logging for a human-readable display of the selected configuration.
func (*Configuration) Track ¶
func (c *Configuration) Track() string
Track returns the selected track of the installer image. This generally maps to one of default, unstable, testing, or stable.
func (*Configuration) UpdateDevices ¶
func (c *Configuration) UpdateDevices(newDevices []string)
UpdateDevices updates the list of devices to be provisioned.
func (*Configuration) UpdateOnly ¶
func (c *Configuration) UpdateOnly() bool
UpdateOnly returns whether only an update is being requested.
func (*Configuration) Warning ¶
func (c *Configuration) Warning() bool
Warning returns whether or not a warning should be presented prior to destructive operations.
type OperatingSystem ¶
type OperatingSystem string
OperatingSystem is used to indicate the OS of the media to be generated.