Documentation
¶
Index ¶
- func GetActiveProfileName(k *koanf.Koanf) string
- func GetOptionValue(opt options.Option) (string, error)
- func KoanfValueFromOption(opt options.Option, pName string) (value string, ok bool, err error)
- func MaskValue(value any) string
- func Validate() (err error)
- type KoanfConfig
- func (k KoanfConfig) ChangeActiveProfile(pName string) (err error)
- func (k KoanfConfig) DefaultMissingKoanfKeys() (err error)
- func (k KoanfConfig) DeleteProfile(pName string) (err error)
- func (k KoanfConfig) GetKoanfConfigFile() string
- func (k KoanfConfig) GetProfileKoanf(pName string) (subKoanf *koanf.Koanf, err error)
- func (k *KoanfConfig) KoanfInstance() *koanf.Koanf
- func (k KoanfConfig) ProfileNames() (profileNames []string)
- func (k KoanfConfig) SaveProfile(pName string, subKoanf *koanf.Koanf) (err error)
- func (k *KoanfConfig) SetKoanfConfigFile(cnfFilePath string)
- func (k KoanfConfig) ValidateExistingProfileName(pName string) (err error)
- func (k KoanfConfig) ValidateNewProfileName(pName string) (err error)
- func (k KoanfConfig) ValidateProfileNameFormat(pName string) (err error)
- func (k KoanfConfig) WriteFile() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetActiveProfileName ¶ added in v0.6.0
func KoanfValueFromOption ¶ added in v0.6.0
Types ¶
type KoanfConfig ¶ added in v0.6.0
type KoanfConfig struct {
// contains filtered or unexported fields
}
func GetKoanfConfig ¶ added in v0.6.0
func GetKoanfConfig() *KoanfConfig
func NewKoanfConfig ¶ added in v0.6.0
func NewKoanfConfig(cnfFilePath string) *KoanfConfig
func (KoanfConfig) ChangeActiveProfile ¶ added in v0.6.0
func (k KoanfConfig) ChangeActiveProfile(pName string) (err error)
func (KoanfConfig) DefaultMissingKoanfKeys ¶ added in v0.6.0
func (k KoanfConfig) DefaultMissingKoanfKeys() (err error)
func (KoanfConfig) DeleteProfile ¶ added in v0.6.0
func (k KoanfConfig) DeleteProfile(pName string) (err error)
func (KoanfConfig) GetKoanfConfigFile ¶ added in v0.6.0
func (k KoanfConfig) GetKoanfConfigFile() string
func (KoanfConfig) GetProfileKoanf ¶ added in v0.6.0
func (k KoanfConfig) GetProfileKoanf(pName string) (subKoanf *koanf.Koanf, err error)
func (*KoanfConfig) KoanfInstance ¶ added in v0.6.0
func (k *KoanfConfig) KoanfInstance() *koanf.Koanf
func (KoanfConfig) ProfileNames ¶ added in v0.6.0
func (k KoanfConfig) ProfileNames() (profileNames []string)
Get all profile names from config.yaml configuration file Returns a sorted slice of profile names
func (KoanfConfig) SaveProfile ¶ added in v0.6.0
func (k KoanfConfig) SaveProfile(pName string, subKoanf *koanf.Koanf) (err error)
func (*KoanfConfig) SetKoanfConfigFile ¶ added in v0.6.0
func (k *KoanfConfig) SetKoanfConfigFile(cnfFilePath string)
func (KoanfConfig) ValidateExistingProfileName ¶ added in v0.6.0
func (k KoanfConfig) ValidateExistingProfileName(pName string) (err error)
The profile name must exist
func (KoanfConfig) ValidateNewProfileName ¶ added in v0.6.0
func (k KoanfConfig) ValidateNewProfileName(pName string) (err error)
The profile name format must be valid The new profile name must be unique
func (KoanfConfig) ValidateProfileNameFormat ¶ added in v0.6.0
func (k KoanfConfig) ValidateProfileNameFormat(pName string) (err error)
The profile name must contain only alphanumeric characters, underscores, and dashes The profile name cannot be empty
func (KoanfConfig) WriteFile ¶ added in v0.6.0
func (k KoanfConfig) WriteFile() (err error)
Click to show internal directories.
Click to hide internal directories.