Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) ConfigFileUsed(configType ConfigType) (string, error)
- func (c *Config) GetBool(key string) (bool, error)
- func (c *Config) GetString(key string) (string, error)
- func (c *Config) GetStringQ(key string) string
- func (c *Config) ReadInConfig(configType ConfigType) error
- func (c *Config) Save(configType ConfigType) error
- func (c *Config) Set(key string, value interface{}) error
- func (c *Config) SetConfigFile(configType ConfigType, in string) error
- func (c *Config) SetConfigPath(configType ConfigType, in string) error
- func (c Config) Validate() (missingSettings []string, ok bool)
- type ConfigProvider
- type ConfigType
- type Ignore
- type Setting
Constants ¶
View Source
const ( //Username on continuous pipe Username = "username" //ApiKey of the user ApiKey = "api-key" //CpAuthenticatorApiAddr target address for cp api calls in the format protocol://host:port CpAuthenticatorApiAddr = "cp-authenticator-api-addr" //CpRiverApiAddr target address for cp api calls in the format protocol://host:port CpRiverApiAddr = "cp-river-api-addr" //CpKubeProxyAddr target address for cp proxy in the format protocol://host:port CpKubeProxyAddr = "cp-kube-proxy-addr" //CpLogProxyAddr target address for the cp log proxy in the format protocol://host:port CpLogProxyAddr = "cp-log-proxy-addr" //AwsS3BucketAddr address of the cp-remote client aws s3 bucket in the format protocol://host:port AwsS3BucketAddr = "aws-s3-bucket-addr" )
View Source
const ( InitToken = "init-token" FlowId = "flow-id" ClusterIdentifier = "cluster-identifier" KubeEnvironmentName = "kube-environment-name" RemoteName = "remote-name" RemoteBranch = "remote-branch" Service = "service" AnybarPort = "anybar-port" RemoteEnvironmentId = "remote-environment-id" InitStatus = "init-status" //settings to disable the kube proxy if required CpKubeProxyEnabled = "kube-proxy-enabled" KubeDirectClusterAddr = "kube-direct-cluster-addr" KubeDirectClusterUser = "kube-direct-cluster-user" KubeDirectClusterPassword = "kube-direct-cluster-password" )
View Source
const GitIgnore = ".gitignore"
View Source
const KubeCtlName = "kubectl"
Variables ¶
View Source
var AppName = os.Args[0]
View Source
var CurrentVersion string
The current version is assigned via ldflags, see Makefile
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
allows to fetch settings either from global or local config
var C *Config
func (*Config) ConfigFileUsed ¶
func (c *Config) ConfigFileUsed(configType ConfigType) (string, error)
set the config file used for the given config type
func (*Config) GetStringQ ¶
GetStringQ calls GetString returning empty if there key didn't match a config handler
func (*Config) ReadInConfig ¶
func (c *Config) ReadInConfig(configType ConfigType) error
reads from the viper config specified in the configType
func (*Config) Save ¶
func (c *Config) Save(configType ConfigType) error
save the local and global settings on disk
func (*Config) SetConfigFile ¶
func (c *Config) SetConfigFile(configType ConfigType, in string) error
set the config file for the given config type
func (*Config) SetConfigPath ¶
func (c *Config) SetConfigPath(configType ConfigType, in string) error
set the config path for the given config type
type ConfigProvider ¶
type ConfigProvider interface { Set(key string, value interface{}) error GetBool(key string) (bool, error) GetString(key string) (string, error) GetStringQ(key string) string SetConfigFile(configType ConfigType, in string) error SetConfigPath(configType ConfigType, in string) error ConfigFileUsed(configType ConfigType) (string, error) ReadInConfig(configType ConfigType) error Save(configType ConfigType) error }
type ConfigType ¶
type ConfigType string
const ( LocalConfigType ConfigType = "local" GlobalConfigType ConfigType = "global" AllConfigTypes ConfigType = "all" )
Click to show internal directories.
Click to hide internal directories.