Documentation
¶
Overview ¶
Package config provides utilities for configuration keys in the configuration files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToValidProfileName ¶
ConvertToValidProfileName will convert input to valid profile name.
func LoadAppConfig ¶
func LoadAppConfig()
LoadAppConfig will initialize application config from viper.
func SetConfigByOption ¶
SetConfigByOption will set the config by a given option-value to the active profile.
func SuggestionsFor ¶
SuggestionsFor provides suggestions for the typedName.
Types ¶
type AppConfig ¶
type AppConfig struct {
ActiveUserProfile string
AccessToKeyring bool
Properties map[string]*Property
CliOpt *CliOption
}
AppConfig is the config of the cli app.
type CliOption ¶
type CliOption struct {
ConfigFile string `mapstructure:"config"`
UserProfile string `mapstructure:"user-profile"`
PlainMode bool `mapstructure:"plain-mode"`
}
CliOption contains all the cli flag options.
type Option ¶
type Option int
Option is the behind number of a config, used for enum.
const ( // ActiveUserProfile is the current active profile. ActiveUserProfile Option = iota // SaasURL is the cloud SaaS url. SaasURL // OrgKey is the org_id. OrgKey // DefaultBuildStep in the default build step. DefaultBuildStep // CBApiID is the carbon black api id; // put under cntOfOptions since the following two options are for auth. CBApiID // CBApiKey is the carbon black api key. CBApiKey )
func (Option) StringWithPrefix ¶
StringWithPrefix will return the option string with a prefix.
Click to show internal directories.
Click to hide internal directories.