Documentation ¶
Index ¶
- func GetOptionValue(opt options.Option) (pFlagValue string, err error)
- func Validate() error
- type ActiveProfile
- type MainConfig
- func (m MainConfig) ActiveProfile() *ActiveProfile
- func (m *MainConfig) ChangeActiveProfile(pName string) (err error)
- func (m MainConfig) ChangeProfileDescription(pName, description string) (err error)
- func (m MainConfig) ChangeProfileName(oldPName, newPName string) (err error)
- func (m MainConfig) DeleteProfile(pName string) (err error)
- func (m MainConfig) ProfileNames() (profileNames []string)
- func (m MainConfig) ProfileToString(pName string) (yamlStr string, err error)
- func (m MainConfig) ProfileViperValue(pName, viperKey string) (yamlStr string, err error)
- func (m MainConfig) SaveProfile(pName string, subViper *viper.Viper) (err error)
- func (m MainConfig) ValidateExistingProfileName(pName string) (err error)
- func (m MainConfig) ValidateNewProfileName(pName string) (err error)
- func (m MainConfig) ValidateProfileNameFormat(pName string) (err error)
- func (m MainConfig) ValidateUpdateExistingProfileName(ePName, newPName string) (err error)
- func (m MainConfig) ViperInstance() *viper.Viper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActiveProfile ¶
type ActiveProfile struct {
// contains filtered or unexported fields
}
func (ActiveProfile) Name ¶
func (a ActiveProfile) Name() string
func (ActiveProfile) ViperInstance ¶
func (a ActiveProfile) ViperInstance() *viper.Viper
type MainConfig ¶
type MainConfig struct {
// contains filtered or unexported fields
}
func NewMainConfig ¶
func NewMainConfig() (newMainViper *MainConfig)
Returns a new MainViper instance
func (MainConfig) ActiveProfile ¶
func (m MainConfig) ActiveProfile() *ActiveProfile
func (*MainConfig) ChangeActiveProfile ¶
func (m *MainConfig) ChangeActiveProfile(pName string) (err error)
func (MainConfig) ChangeProfileDescription ¶
func (m MainConfig) ChangeProfileDescription(pName, description string) (err error)
func (MainConfig) ChangeProfileName ¶
func (m MainConfig) ChangeProfileName(oldPName, newPName string) (err error)
func (MainConfig) DeleteProfile ¶
func (m MainConfig) DeleteProfile(pName string) (err error)
Viper gives no built-in delete or unset method for keys Using this "workaround" described here: https://github.com/spf13/viper/issues/632
func (MainConfig) ProfileNames ¶
func (m MainConfig) ProfileNames() (profileNames []string)
Get all profile names from config.yaml configuration file
func (MainConfig) ProfileToString ¶
func (m MainConfig) ProfileToString(pName string) (yamlStr string, err error)
func (MainConfig) ProfileViperValue ¶
func (m MainConfig) ProfileViperValue(pName, viperKey string) (yamlStr string, err error)
func (MainConfig) SaveProfile ¶
func (m MainConfig) SaveProfile(pName string, subViper *viper.Viper) (err error)
func (MainConfig) ValidateExistingProfileName ¶
func (m MainConfig) ValidateExistingProfileName(pName string) (err error)
The profile name format must be valid The profile name must exist
func (MainConfig) ValidateNewProfileName ¶
func (m MainConfig) ValidateNewProfileName(pName string) (err error)
The profile name format must be valid The new profile name must be unique
func (MainConfig) ValidateProfileNameFormat ¶
func (m MainConfig) ValidateProfileNameFormat(pName string) (err error)
The profile name must contain only alphanumeric characters, underscores, and dashes The profile name cannot be empty
func (MainConfig) ValidateUpdateExistingProfileName ¶
func (m MainConfig) ValidateUpdateExistingProfileName(ePName, newPName string) (err error)
If the new profile name is the same as the existing profile name, that is valid Otherwise treat newPName as a new profile name and validate it
func (MainConfig) ViperInstance ¶
func (m MainConfig) ViperInstance() *viper.Viper
Click to show internal directories.
Click to hide internal directories.