config

package
v5.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentConfigVersion = "1.0"

CurrentConfigVersion holds the current version of the config file

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

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

Variables

View Source
var CurrentStateVersion = "1.0"

CurrentStateVersion is the current revision for the state file structure

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(localrpms bool) 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) LoadConfig

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

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

func (*MixConfig) LoadDefaults

func (config *MixConfig) LoadDefaults(localrpms bool) error

LoadDefaults sets sane values for the config properties

func (*MixConfig) LoadDefaultsForPath

func (config *MixConfig) LoadDefaultsForPath(localrpms bool, 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() error

Load the mixer.state file

func (*MixState) LoadDefaults

func (state *MixState) LoadDefaults()

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