Documentation ¶
Index ¶
- Constants
- Variables
- func ArchString() string
- func CheckRequiredAssociation(settings *models.Settings) error
- func SaveSettings(settings *models.Settings) error
- func SetGivenEnv(envMatch string, settings *models.Settings)
- func StoreEnvironments(envs *[]models.Environment, settings *models.Settings)
- type FileSettingsRetriever
- type SettingsRetriever
Constants ¶
const ( // VERSION is the current cli version VERSION = "4.2.3" // Beta determines whether or not this is a beta build of the CLI Beta = false // AccountsHost is the production accounts URL AccountsHost = "https://product.datica.com" // AuthHost is the production auth URL AuthHost = "https://auth.catalyze.io" // AuthHostVersion is the version path for the auth host AuthHostVersion = "" // PaasHost is the production PaaS URL PaasHost = "https://paas-api.catalyze.io" // PaasHostVersion is the version path for the PaaS host PaasHostVersion = "" // LogLevel is the amount of logging to enable LogLevel = logrus.InfoLevel // JobPollTime is the amount of time in seconds to wait between polls for a job status JobPollTime = 5 // LogPollTime is the amount of time in seconds to wait between polls for new logs LogPollTime = 3 // AccountsHostEnvVar is the env variable used to override AccountsHost AccountsHostEnvVar = "ACCOUNTS_HOST" // AuthHostEnvVar is the env variable used to override AuthHost AuthHostEnvVar = "AUTH_HOST" // PaasHostEnvVar is the env variable used to override PaasHost PaasHostEnvVar = "PAAS_HOST" // AuthHostVersionEnvVar is the env variable used to override AuthHostVersion AuthHostVersionEnvVar = "AUTH_HOST_VERSION" // PaasHostVersionEnvVar is the env variable used to override PaasHostVersion PaasHostVersionEnvVar = "PAAS_HOST_VERSION" // DaticaEmailEnvVar is the env variable used to override the email DaticaEmailEnvVar = "DATICA_EMAIL" // DaticaPasswordEnvVar is the env variable used to override the passowrd DaticaPasswordEnvVar = "DATICA_PASSWORD" // DaticaEnvironmentEnvVar is the env variable used to override the environment used in the current command DaticaEnvironmentEnvVar = "DATICA_ENV" // LogLevelEnvVar is the env variable used to override the logging level used LogLevelEnvVar = "DATICA_LOG_LEVEL" // SkipVerifyEnvVar is the env variable used to accept invalid SSL certificates SkipVerifyEnvVar = "SKIP_VERIFY" // DaticaConfigFile points the CLI at a .datica file DaticaConfigFile = "DATICA_CONFIG_FILE" // DaticaUsernameEnvVarDeprecated is the deprecated env variable used to override the username DaticaUsernameEnvVarDeprecated = "DATICA_USERNAME" // InvalidChars is a string containing all invalid characters for naming InvalidChars = "/?%" )
const (
OldSettingsFile = ".catalyze"
)
Variables ¶
var SettingsFile = resolveSettingsPath()
Functions ¶
func ArchString ¶
func ArchString() string
ArchString translates the current architecture into an easier to read value. amd64 becomes 64-bit, 386 becomes 32-bit, etc.
func CheckRequiredAssociation ¶
CheckRequiredAssociation ensures if an association is required for a command to run, that an appropriate environment has been picked and values assigned to the given settings object before a command is run. This is intended to be called before every command.
func SaveSettings ¶
SaveSettings persists the settings to disk
func SetGivenEnv ¶
SetGivenEnv takes the given env name and finds it in the env list in the given settings object. It then populates the EnvironmentID and ServiceID on the settings object with appropriate values.
func StoreEnvironments ¶
func StoreEnvironments(envs *[]models.Environment, settings *models.Settings)
Types ¶
type FileSettingsRetriever ¶
type FileSettingsRetriever struct{}
FileSettingsRetriever reads in data from the SettingsFile and generates a settings object.
func (FileSettingsRetriever) GetSettings ¶
func (s FileSettingsRetriever) GetSettings(envName, svcName, accountsHost, authHost, ignoreAuthHostVersion, paasHost, ignorePaasHostVersion, email, password string) (*models.Settings, error)
GetSettings returns a Settings object for the current context
type SettingsRetriever ¶
type SettingsRetriever interface {
GetSettings(string, string, string, string, string, string, string, string, string) (*models.Settings, error)
}
SettingsRetriever defines an interface for a class responsible for generating a settings object used for most commands in the CLI. Some examples might be for retrieving settings based on the settings file or generating a settings object based on a directly entered environment ID and service ID.