config

package
v2.0.0-snapshot...-58e3a78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VERSION is the current cli version
	VERSION = "3.4.0"
	// Beta determines whether or not this is a beta build of the CLI
	Beta = false
	// AccountsHost is the production accounts URL
	AccountsHost = "https://product.catalyze.io/stratum"
	// 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"
	// CatalyzeUsernameEnvVar is the env variable used to override the username
	CatalyzeUsernameEnvVar = "CATALYZE_USERNAME"
	// CatalyzePasswordEnvVar is the env variable used to override the passowrd
	CatalyzePasswordEnvVar = "CATALYZE_PASSWORD"
	// CatalyzeEnvironmentEnvVar is the env variable used to override the environment used in the current command
	CatalyzeEnvironmentEnvVar = "CATALYZE_ENV"
	// LogLevelEnvVar is the env variable used to override the logging level used
	LogLevelEnvVar = "CATALYZE_LOG_LEVEL"
	// SkipVerifyEnvVar is the env variable used to accept invalid SSL certificates
	SkipVerifyEnvVar = "SKIP_VERIFY"

	// InvalidChars is a string containing all invalid characters for naming
	InvalidChars = "/?%"
)
View Source
const SettingsFile = ".catalyze"

SettingsPath is the location of the catalyze config file.

Variables

View Source
var ErrEnvRequired = errors.New("No Catalyze environment has been associated. Run \"catalyze associate\" from a local git repo first")

ErrEnvRequired is thrown when a command is run that requires an environment to be associated first

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

func CheckRequiredAssociation(required, prompt bool, settings *models.Settings) error

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 DeleteBreadcrumb

func DeleteBreadcrumb(alias string, settings *models.Settings) error

DeleteBreadcrumb removes the environment in the global list

func SaveSettings

func SaveSettings(settings *models.Settings)

SaveSettings persists the settings to disk

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, username, password string) *models.Settings

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
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL