config

package
v6.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentConfigVersion = "1.2"

CurrentConfigVersion holds the current version of the config file

View Source
const CurrentStateVersion = "1.1"

CurrentStateVersion is the current revision for the state file structure

View Source
const DefaultFormatPath = "/usr/share/defaults/swupd/format"

DefaultFormatPath is the default path for the format file specified by swupd

Variables

This section is empty.

Functions

This section is empty.

Types

type MixConfig

type MixConfig struct {
	Builder builderConf
	Swupd   swupdConf
	Server  serverConf
	Mixer   mixerConf
	// contains filtered or unexported fields
}

MixConfig represents the config parameters found in the builder config file.

func (*MixConfig) Convert

func (config *MixConfig) Convert(filename string) error

Convert parses an old config file and converts it to TOML format

func (*MixConfig) CreateDefaultConfig

func (config *MixConfig) CreateDefaultConfig() error

CreateDefaultConfig creates a default builder.conf using the active directory as base path for the variables values.

func (*MixConfig) GetConfigFileName

func (config *MixConfig) GetConfigFileName() string

GetConfigFileName returns the file name of current config

func (*MixConfig) InitConfigPath

func (config *MixConfig) InitConfigPath(fullpath string) error

InitConfigPath sets the main config name to what was passed in, or defaults to the current working directory + builder.conf

func (*MixConfig) LoadConfig

func (config *MixConfig) LoadConfig(filename string) error

LoadConfig loads a configuration file from a provided path or from local directory if none is provided

func (*MixConfig) LoadDefaults

func (config *MixConfig) LoadDefaults() error

LoadDefaults sets sane values for the config properties

func (*MixConfig) LoadDefaultsForPath

func (config *MixConfig) LoadDefaultsForPath(path string)

LoadDefaultsForPath sets sane values for config properties using `path` as base directory

func (*MixConfig) Print

func (config *MixConfig) Print() error

Print print variables and values of a MixConfig struct

func (*MixConfig) SaveConfig

func (config *MixConfig) SaveConfig() error

SaveConfig saves the properties in MixConfig to a TOML config file

func (*MixConfig) SetProperty

func (config *MixConfig) SetProperty(propertyStr string, value string) error

SetProperty parse a property in the format "Section.Property", finds and sets it within the config structure and saves the config file.

type MixState

type MixState struct {
	Mix mixSection
	// contains filtered or unexported fields
}

MixState holds the current state of the mix

func (*MixState) Load

func (state *MixState) Load(config MixConfig) error

Load the mixer.state file

func (*MixState) LoadDefaults

func (state *MixState) LoadDefaults(config MixConfig)

LoadDefaults initialize the state object with sane values

func (*MixState) Save

func (state *MixState) Save() error

Save creates or overwrites the mixer.state file

Jump to

Keyboard shortcuts

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