Documentation ¶
Index ¶
- Constants
- func IsUserFriendlyNamesEnabled() (bool, error)
- func SaveConfig(config *Configuration, filePath string) (err error)
- func TakeBackupOfConfFile(srcFile string, backupSuffix string) (err error)
- type Configuration
- func (config *Configuration) AddSection(sectionName string, parent *Section) (section *Section, err error)
- func (config *Configuration) GetNimbleSection() (section *Section, err error)
- func (config *Configuration) GetRoot() *Section
- func (config *Configuration) GetSection(sectionName, vendor string) (section *Section, err error)
- func (config *Configuration) PrintConf() (conf []string)
- type Duplicate
- type Section
- func (section *Section) GetChildren() *list.List
- func (section *Section) GetName() string
- func (section *Section) GetParent() *Section
- func (section *Section) GetProperties() map[string]string
- func (section *Section) PrintSection(indent int) (conf []string)
- func (section *Section) SetParent(parent *Section)
Constants ¶
const ( // NEWLINE indicates new line character NEWLINE = "\n" // MPATHCONF indicates configuration file path for multipathd MPATHCONF = "/etc/multipath.conf" // SectionNotFoundError represents error when section with given name is not found in config SectionNotFoundError = "unable to find section" // NimbleBackupSuffix common suffix for all file backups NimbleBackupSuffix = "nimblebackup" )
Variables ¶
This section is empty.
Functions ¶
func IsUserFriendlyNamesEnabled ¶
IsUserFriendlyNamesEnabled returns true if user_friendly_names is enabled
func SaveConfig ¶
func SaveConfig(config *Configuration, filePath string) (err error)
SaveConfig writes corrected config to file after taking backup
func TakeBackupOfConfFile ¶
TakeBackupOfConfFile take a backup of srcFile after taking backup in same directory with suffix and timestamp appended
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration represents entire multipath.conf along with all sections
func ParseConfig ¶
func ParseConfig(filePath string) (config *Configuration, err error)
ParseConfig reads and parses give config file into sections
func (*Configuration) AddSection ¶
func (config *Configuration) AddSection(sectionName string, parent *Section) (section *Section, err error)
AddSection adds a new section into config
func (*Configuration) GetNimbleSection ¶
func (config *Configuration) GetNimbleSection() (section *Section, err error)
GetNimbleSection gets nimble device section in /etc/multipath.conf
func (*Configuration) GetRoot ¶
func (config *Configuration) GetRoot() *Section
GetRoot returns the root section
func (*Configuration) GetSection ¶
func (config *Configuration) GetSection(sectionName, vendor string) (section *Section, err error)
GetSection returns section with matching name
func (*Configuration) PrintConf ¶
func (config *Configuration) PrintConf() (conf []string)
PrintConf returns the string representation of current section and all child sections
type Duplicate ¶
type Duplicate struct {
// contains filtered or unexported fields
}
Duplicate manages duplicate params with same key in defaults section
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section represents a multipath.conf section embedded between { and }
func GetDefaultsSection ¶
GetDefaultsSection returns defaults{} section from multipath.conf
func (*Section) GetChildren ¶
GetChildren returns the list of child sections
func (*Section) GetProperties ¶
GetProperties returns the key value properties in current section
func (*Section) PrintSection ¶
PrintSection returns each section in string format