Documentation ¶
Index ¶
- func CreateConfigTemplateFile(filename string) error
- func WriteByteToFile(filename string, fileData []byte) error
- type Configuration
- func (c *Configuration) AddProfile(name string, username string, token string, domainid string, region string, ...) error
- func (c *Configuration) GetActiveProfile() string
- func (c *Configuration) GetProfileMap(profile string) (map[string]interface{}, error)
- func (c *Configuration) ProfilesSlice() []string
- func (c *Configuration) SetActiveProfile(profile string) error
- func (c *Configuration) SetProfileField(key string, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfigTemplateFile ¶
Create configuration template file on specified path.
func WriteByteToFile ¶
Types ¶
type Configuration ¶
type Configuration struct { Location string // contains filtered or unexported fields }
func InitConfiguration ¶
func InitConfiguration(path string) (*Configuration, error)
Load configuration profiles from a yaml file on specified path.
func (*Configuration) AddProfile ¶
func (c *Configuration) AddProfile(name string, username string, token string, domainid string, region string, projectid string, apiurl string) error
Add new profile to the configuration file.
func (*Configuration) GetActiveProfile ¶
func (c *Configuration) GetActiveProfile() string
Return current active profile name.
func (*Configuration) GetProfileMap ¶
func (c *Configuration) GetProfileMap(profile string) (map[string]interface{}, error)
Return profile map[FieldTag]FieldValue.
func (*Configuration) ProfilesSlice ¶
func (c *Configuration) ProfilesSlice() []string
Return profile names slice.
func (*Configuration) SetActiveProfile ¶
func (c *Configuration) SetActiveProfile(profile string) error
Set active profile from existing profiles in the file.
func (*Configuration) SetProfileField ¶
func (c *Configuration) SetProfileField(key string, value string) error
Set arbitrary (among available profile fields) profile field value.
Click to show internal directories.
Click to hide internal directories.