Documentation
¶
Index ¶
- Variables
- type AppConfig
- func (a AppConfig) GetDevelopmentDependencyNames() []string
- func (a AppConfig) GetProductionDependencyNames() []string
- func (a AppConfig) GetServiceData() map[string]ServiceData
- func (a AppConfig) GetServiceProtectionLevels() map[string]string
- func (a AppConfig) GetSilencedDevelopmentDependencyNames() []string
- func (a AppConfig) GetSilencedServiceRoles() []string
- func (a AppConfig) GetSortedServiceRoles() []string
- func (a AppConfig) VerifyServiceRoleDoesNotExist(serviceRole string) error
- type AppContext
- type AppDevelopmentConfig
- type AppProductionConfig
- type AwsConfig
- type Context
- type DeployConfig
- type DevelopmentDependencyConfig
- type DevelopmentDependencyConfigOptions
- type DockerCompose
- type DockerConfig
- type DockerConfigs
- type EnvVars
- type MessageTranslation
- type ProductionDependencyConfig
- type ProductionDependencyConfigOptions
- type RdsConfig
- type Secrets
- type ServiceConfig
- type ServiceContext
- type ServiceData
- type ServiceDevelopmentConfig
- type ServiceEnvVarNames
- type ServiceMessages
- type ServiceProductionConfig
- type Services
- type ShutdownConfig
Constants ¶
This section is empty.
Variables ¶
var DbDependencies = map[string]string{
"postgres": "rds",
"mysql": "rds",
}
DbDependencies is a map from db engines to their underlying dependency
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { Name string Description string Version string Development AppDevelopmentConfig `yaml:",omitempty"` Production AppProductionConfig `yaml:",omitempty"` Services Services Templates map[string]string `yaml:",omitempty"` }
AppConfig represents the configuration of an application
func NewAppConfig ¶
NewAppConfig reads application.yml and returns the appConfig object
func (AppConfig) GetDevelopmentDependencyNames ¶ added in v0.26.0
GetDevelopmentDependencyNames returns the names of all dev dependencies listed in appConfig
func (AppConfig) GetProductionDependencyNames ¶ added in v0.26.0
GetProductionDependencyNames returns the names of all prod dependencies listed in appConfig
func (AppConfig) GetServiceData ¶
func (a AppConfig) GetServiceData() map[string]ServiceData
GetServiceData returns the configuration data listed under a service role in application.yml
func (AppConfig) GetServiceProtectionLevels ¶
GetServiceProtectionLevels returns a map containing service role to protection level
func (AppConfig) GetSilencedDevelopmentDependencyNames ¶ added in v0.26.0
GetSilencedDevelopmentDependencyNames returns the names of development dependencies that are configured as silent
func (AppConfig) GetSilencedServiceRoles ¶ added in v0.28.0
GetSilencedServiceRoles returns the names of services that are configured as silent
func (AppConfig) GetSortedServiceRoles ¶ added in v0.28.0
GetSortedServiceRoles returns the service roles listed in application.yml sorted alphabetically
func (AppConfig) VerifyServiceRoleDoesNotExist ¶ added in v0.28.0
VerifyServiceRoleDoesNotExist returns an error if the serviceRole already exists in existingServices, and return nil otherwise.
type AppContext ¶ added in v0.27.0
AppContext represents the exosphere application the user is running
func GetAppContext ¶ added in v0.27.0
func GetAppContext(location string) (AppContext, error)
GetAppContext returns an AppContext for the application found at the passed location by walkig up the directory tree until it finds an application.yml
func (AppContext) GetServiceContext ¶ added in v0.28.1
func (a AppContext) GetServiceContext(location string) (ServiceContext, error)
GetServiceContext returns a ServiceContext for the service found at the passed location
type AppDevelopmentConfig ¶ added in v0.26.0
type AppDevelopmentConfig struct {
Dependencies []DevelopmentDependencyConfig
}
AppDevelopmentConfig represents development specific configuration for an application
type AppProductionConfig ¶ added in v0.26.0
type AppProductionConfig struct { Dependencies []ProductionDependencyConfig URL string `yaml:",omitempty"` Region string `yaml:",omitempty"` AccountID string `yaml:"account-id,omitempty"` SslCertificateArn string `yaml:"ssl-certificate-arn,omitempty"` }
AppProductionConfig represents production specific configuration for an application
func (AppProductionConfig) ValidateFields ¶ added in v0.26.0
func (p AppProductionConfig) ValidateFields() error
ValidateFields validates that the production section contiains the required fields
type AwsConfig ¶
type AwsConfig struct { Region string AccountID string SslCertificateArn string Profile string SecretsBucket string TerraformStateBucket string TerraformLockTable string }
AwsConfig contains top level information about an application's AWS account
type Context ¶ added in v0.27.0
type Context struct { AppContext AppContext ServiceContext ServiceContext HasServiceContext bool }
Context represents contextual information about what application/service the user is running
type DeployConfig ¶
type DeployConfig struct { AppConfig AppConfig ServiceConfigs map[string]ServiceConfig Logger *util.Logger AppDir string HomeDir string DockerComposeProjectName string TerraformDir string SecretsPath string AwsConfig AwsConfig DeployServicesOnly bool TerraformModulesRef string }
DeployConfig contains information needed for deployment
type DevelopmentDependencyConfig ¶ added in v0.26.0
type DevelopmentDependencyConfig struct { Config DevelopmentDependencyConfigOptions `yaml:",omitempty"` Silent bool `yaml:",omitempty"` Name string Version string }
DevelopmentDependencyConfig represents a development dependency
type DevelopmentDependencyConfigOptions ¶ added in v0.26.0
type DevelopmentDependencyConfigOptions struct { Ports []string `yaml:",omitempty"` Volumes []string `yaml:",omitempty"` OnlineText string `yaml:"online-text,omitempty"` DependencyEnvironment map[string]string `yaml:"dependency-environment,omitempty"` ServiceEnvironment map[string]string `yaml:"service-environment,omitempty"` }
DevelopmentDependencyConfigOptions represents the configuration of a dependency
func (*DevelopmentDependencyConfigOptions) IsEmpty ¶ added in v0.26.0
func (d *DevelopmentDependencyConfigOptions) IsEmpty() bool
IsEmpty returns true if the given dependencyConfig object is empty
type DockerCompose ¶
type DockerCompose struct { Version string Services DockerConfigs }
DockerCompose represents the docker compose object
type DockerConfig ¶
type DockerConfig struct { Image string `yaml:",omitempty"` Build map[string]string `yaml:",omitempty"` Command string `yaml:",omitempty"` ContainerName string `yaml:"container_name,omitempty"` Ports []string `yaml:",omitempty"` Volumes []string `yaml:",omitempty"` Links []string `yaml:",omitempty"` Environment map[string]string `yaml:",omitempty"` DependsOn []string `yaml:"depends_on,omitempty"` }
DockerConfig represents the configuration of a service/dependency as provided in docker-compose.yml
type DockerConfigs ¶
type DockerConfigs map[string]DockerConfig
DockerConfigs represents a map of DockerConfig structs
func (DockerConfigs) Merge ¶
func (d DockerConfigs) Merge(maps ...DockerConfigs) DockerConfigs
Merge joins the given docker config maps into one
type EnvVars ¶
type EnvVars struct { Default map[string]string `yaml:",omitempty"` Development map[string]string `yaml:",omitempty"` Production map[string]string `yaml:",omitempty"` Secrets []string `yaml:",omitempty"` }
EnvVars is the environment key listed in a ServiceConfig
type MessageTranslation ¶
MessageTranslation is the mapping from public to internal message names
type ProductionDependencyConfig ¶ added in v0.26.0
type ProductionDependencyConfig struct { Config ProductionDependencyConfigOptions `yaml:",omitempty"` Name string Version string }
ProductionDependencyConfig represents a production dependency
func (*ProductionDependencyConfig) GetDbDependency ¶ added in v0.26.3
func (p *ProductionDependencyConfig) GetDbDependency() string
GetDbDependency returns a map of db engines to the underlying dependency
func (*ProductionDependencyConfig) ValidateFields ¶ added in v0.26.3
func (p *ProductionDependencyConfig) ValidateFields() error
ValidateFields validates that a production config contains all required fields
type ProductionDependencyConfigOptions ¶ added in v0.26.0
type ProductionDependencyConfigOptions struct {
Rds RdsConfig `yaml:",omitempty"`
}
ProductionDependencyConfigOptions represents the configuration of a development dependency
func (*ProductionDependencyConfigOptions) IsEmpty ¶ added in v0.26.0
func (d *ProductionDependencyConfigOptions) IsEmpty() bool
IsEmpty returns true if the given config object is empty
type RdsConfig ¶ added in v0.26.1
type RdsConfig struct { AllocatedStorage string `yaml:"allocated-storage,omitempty"` InstanceClass string `yaml:"instance-class,omitempty"` DbName string `yaml:"db-name,omitempty"` Username string `yaml:",omitempty"` PasswordSecretName string `yaml:"password-secret-name,omitempty"` //TODO: verify this is set via exo configure StorageType string `yaml:"storage-type,omitempty"` ServiceEnvVarNames ServiceEnvVarNames `yaml:"service-env-var-names,omitempty"` }
RdsConfig holds configuration fields for an rds dependency
func (*RdsConfig) IsEmpty ¶ added in v0.26.1
IsEmpty returns true if the given config object is empty
func (*RdsConfig) ValidateFields ¶ added in v0.26.3
ValidateFields validates that an rds config contains all required fields
type Secrets ¶
Secrets map contains maps from secret keys to values
type ServiceConfig ¶
type ServiceConfig struct { Type string `yaml:",omitempty"` Description string `yaml:",omitempty"` Author string `yaml:",omitempty"` Startup map[string]string `yaml:",omitempty"` Restart map[string]interface{} `yaml:",omitempty"` ServiceMessages `yaml:"messages,omitempty"` Docker DockerConfig `yaml:",omitempty"` Environment EnvVars `yaml:",omitempty"` Development ServiceDevelopmentConfig `yaml:",omitempty"` Production ServiceProductionConfig `yaml:",omitempty"` }
ServiceConfig represents the configuration of a service as provided in service.yml
func (ServiceConfig) GetEnvVars ¶
func (s ServiceConfig) GetEnvVars(environment string) (map[string]string, []string)
GetEnvVars compiles a service's environment variables It overwrites default variables with environemnt specific ones, returning a map of public env vars and a list of private env var keys
type ServiceContext ¶ added in v0.27.0
type ServiceContext struct { Dir string Location string Config ServiceConfig AppContext AppContext ServiceData *ServiceData }
ServiceContext represents the exosphere service the user is running
type ServiceData ¶
type ServiceData struct { Location string `yaml:",omitempty"` DockerImage string `yaml:"docker-image,omitempty"` MessageTranslations []MessageTranslation `yaml:"message-translation,omitempty"` Silent bool `yaml:",omitempty"` }
ServiceData represents the service info as provided in application.yml
type ServiceDevelopmentConfig ¶ added in v0.26.0
type ServiceDevelopmentConfig struct { Dependencies []DevelopmentDependencyConfig Scripts map[string]string `yaml:",omitempty"` }
ServiceDevelopmentConfig represents development specific configuration for a service
type ServiceEnvVarNames ¶ added in v0.27.0
type ServiceEnvVarNames struct { DbName string `yaml:"db-name,omitempty"` Username string `yaml:",omitempty"` Password string `yaml:",omitempty"` }
ServiceEnvVarNames are the names of RDS related env vars injected into a service
type ServiceMessages ¶
ServiceMessages represents the messages that the service sends and receives
type ServiceProductionConfig ¶ added in v0.26.0
type ServiceProductionConfig struct { Dependencies []ProductionDependencyConfig URL string `yaml:"url,omitempty"` CPU string `yaml:"cpu,omitempty"` Memory string `yaml:"memory,omitempty"` PublicPort string `yaml:"public-port,omitempty"` HealthCheck string `yaml:"health-check,omitempty"` }
ServiceProductionConfig represents production specific configuration for an application
func (ServiceProductionConfig) ValidateFields ¶ added in v0.26.0
func (p ServiceProductionConfig) ValidateFields(serviceLocation, protectionLevel string) error
ValidateFields validates that service.yml contiains the required fields
type Services ¶
type Services struct { Public map[string]ServiceData Private map[string]ServiceData Worker map[string]ServiceData }
Services represents the mapping of protection level to services
type ShutdownConfig ¶
ShutdownConfig represents the configuration to use when shutting down an application
Source Files
¶
- app_config.go
- app_context.go
- app_development_config.go
- app_production_config.go
- aws_config.go
- context.go
- deploy_config.go
- development_dependency_config.go
- development_dependency_config_options.go
- docker_compose.go
- docker_config.go
- docker_configs.go
- env_vars.go
- message_translation.go
- production_dependency_config.go
- production_dependency_config_options.go
- rds_config.go
- secrets.go
- service_config.go
- service_context.go
- service_data.go
- service_development_config.go
- service_messages.go
- service_production_config.go
- services.go
- shutdown_config.go