config

package
v4.6.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseNewConfig = false

UseNewConfig controls whether to use the new TOML config format. This is an experimental feature.

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) Parse

func (config *MixConfig) Parse() error

Parse reads the values from a config file without performing validation or env expansion

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.

Jump to

Keyboard shortcuts

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