Documentation
¶
Index ¶
- Constants
- Variables
- func GetComposeFileNames() []string
- type AppConfig
- type AppRemoteConfig
- type AppRemoteEnvironment
- type BuildMode
- type BuildModeEnvironment
- type BuildModeType
- type DockerCompose
- type DockerConfig
- type DockerConfigs
- type LocalConfig
- type LocalDependency
- type MessageTranslation
- type RdsConfig
- type RemoteDependency
- type Secrets
- type ServiceConfig
- type ServiceDependencyData
- type ServiceDevelopmentConfig
- type ServiceEnvVarNames
- type ServiceMessages
- type ServiceProductionConfig
- type ServiceRemoteConfig
- type ServiceRemoteEnvironment
- type ServiceSource
- type ShutdownConfig
- type TestResult
Constants ¶
const ( BuildModeTypeLocal = iota BuildModeTypeDeploy )
Possible values for BuildModeType
const ( BuildModeEnvironmentTest = iota BuildModeEnvironmentDevelopment BuildModeEnvironmentProduction )
Possible values for BuildModeEnvironment
const LocalDevelopmentComposeFileName = "run_development.yml"
LocalDevelopmentComposeFileName is the docker-compose file name for local development runs
const LocalProductionComposeFileName = "run_production.yml"
LocalProductionComposeFileName is the docker-compose file name for local production runs
const LocalTestComposeFileName = "test.yml"
LocalTestComposeFileName is the docker-compose file name for local test runs
const ServiceTypePublic = "public"
ServiceTypePublic is the value for the type field of a public service
const ServiceTypeWorker = "worker"
ServiceTypeWorker is the value for the type field of a worker service
Variables ¶
var BuildModeDeploy = BuildMode{ Type: BuildModeTypeDeploy, Environment: BuildModeEnvironmentProduction, }
BuildModeDeploy is the BuildMode for deployments
Functions ¶
func GetComposeFileNames ¶ added in v0.32.0
func GetComposeFileNames() []string
GetComposeFileNames returns a list of docker-compose file names for local run processes
Types ¶
type AppConfig ¶
type AppConfig struct {
Name string
Local LocalConfig `yaml:",omitempty"`
Remote AppRemoteConfig `yaml:",omitempty"`
Services map[string]ServiceSource
}
AppConfig represents the configuration of an application
func NewAppConfig ¶
NewAppConfig reads application.yml and returns the appConfig object
func (*AppConfig) AddService ¶ added in v0.36.0
AddService adds serviceRole to the appConfig object
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 AppRemoteConfig ¶ added in v0.32.0
type AppRemoteConfig struct {
Dependencies map[string]RemoteDependency
Environments map[string]AppRemoteEnvironment
}
AppRemoteConfig represents production specific configuration for an application
func (AppRemoteConfig) ValidateFields ¶ added in v0.32.0
func (p AppRemoteConfig) ValidateFields(remoteEnvironmentID string) error
ValidateFields validates that this section contains the required fields
type AppRemoteEnvironment ¶ added in v0.35.0
type AppRemoteEnvironment struct {
EnvironmentVariables map[string]string `yaml:"environment-variables,omitempty"`
Secrets []string `yaml:",omitempty"`
URL string `yaml:",omitempty"`
Region string `yaml:",omitempty"`
AccountID string `yaml:"account-id,omitempty"`
SslCertificateArn string `yaml:"ssl-certificate-arn,omitempty"`
}
AppRemoteEnvironment represents represents configuration for a particular environment
func (AppRemoteEnvironment) ValidateFields ¶ added in v0.35.0
func (a AppRemoteEnvironment) ValidateFields(remoteEnvironmentID string) error
ValidateFields validates that the production section contiains the required fields
type BuildMode ¶ added in v0.32.0
type BuildMode struct {
Type BuildModeType
Mount bool
Environment BuildModeEnvironment
}
BuildMode determines what type of docker compose config should be created
func (BuildMode) GetDockerComposeFileName ¶ added in v0.32.0
GetDockerComposeFileName returns the proper docker-compose file name for the build environment
type BuildModeEnvironment ¶ added in v0.32.0
type BuildModeEnvironment uint
BuildModeEnvironment indicates which environment to build the docker compose config for
type BuildModeType ¶ added in v0.32.0
type BuildModeType uint
BuildModeType indicates whether the docker compose config should be created local use or for deployment
type DockerCompose ¶
type DockerCompose struct {
Version string
Services DockerConfigs
Volumes map[string]interface{}
}
DockerCompose represents the docker compose object
func NewDockerCompose ¶ added in v0.32.0
func NewDockerCompose() *DockerCompose
NewDockerCompose returns a docker compose object
func (*DockerCompose) Merge ¶ added in v0.32.0
func (d *DockerCompose) Merge(objs ...*DockerCompose) *DockerCompose
Merge joins the given docker compose objects into one
type DockerConfig ¶
type DockerConfig struct {
Image string `yaml:",omitempty"`
Build map[string]string `yaml:",omitempty"`
Command string `yaml:",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"`
Restart string `yaml:",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 LocalConfig ¶ added in v0.32.0
type LocalConfig struct {
Dependencies map[string]LocalDependency
EnvironmentVariables map[string]string `yaml:"environment-variables,omitempty"`
Secrets []string `yaml:",omitempty"`
}
LocalConfig represents development specific configuration for an application
type LocalDependency ¶ added in v0.32.0
type LocalDependency struct {
Image string
Persist []string `yaml:",omitempty"`
EnvironmentVariables map[string]string `yaml:"environment-variables,omitempty"`
Secrets []string `yaml:",omitempty"`
}
LocalDependency represents a development dependency
type MessageTranslation ¶
MessageTranslation is the mapping from public to internal message names
type RdsConfig ¶ added in v0.26.1
type RdsConfig struct {
Engine string `yaml:",omitempty"`
EngineVersion string `yaml:"engine-version,omitempty"`
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) ValidateFields ¶ added in v0.26.3
ValidateFields validates that an rds config contains all required fields
type RemoteDependency ¶ added in v0.32.0
type RemoteDependency struct {
Type string
TemplateConfig map[string]string `yaml:"template-config,omitempty"`
}
RemoteDependency represents a production dependency
func (*RemoteDependency) ValidateFields ¶ added in v0.32.0
func (p *RemoteDependency) ValidateFields() error
ValidateFields validates that a remote 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"`
DependencyData ServiceDependencyData `yaml:"dependency-data,omitempty"`
Development ServiceDevelopmentConfig `yaml:",omitempty"`
Local LocalConfig `yaml:",omitempty"`
Production ServiceProductionConfig `yaml:",omitempty"`
Remote ServiceRemoteConfig
}
ServiceConfig represents the configuration of a service as provided in service.yml
func NewServiceConfig ¶ added in v0.31.0
func NewServiceConfig(serviceLocation string) (ServiceConfig, error)
NewServiceConfig returns a validated ServiceConfig object given the app directory path and the directory name of a service
func (ServiceConfig) ValidateDeployFields ¶ added in v0.32.0
func (s ServiceConfig) ValidateDeployFields(serviceLocation, remoteEnvironmentID string) error
ValidateDeployFields validates a serviceConfig for deployment
func (ServiceConfig) ValidateServiceConfig ¶ added in v0.31.0
func (s ServiceConfig) ValidateServiceConfig() error
ValidateServiceConfig validates a ServiceConfig object
type ServiceDependencyData ¶ added in v0.33.0
ServiceDependencyData represents data about a service to be passed to a dependencies The first key is the dependency name, the value is data to the passed to the dependency
func (ServiceDependencyData) StringifyMapKeys ¶ added in v0.33.0
func (s ServiceDependencyData) StringifyMapKeys()
StringifyMapKeys converts any maps in the data to having keys of string instead of interface
type ServiceDevelopmentConfig ¶ added in v0.26.0
type ServiceDevelopmentConfig struct {
Port string `yaml:",omitempty"`
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 {
Port string `yaml:"port,omitempty"`
HealthCheck string `yaml:"health-check,omitempty"`
}
ServiceProductionConfig represents production specific configuration for an application
func (ServiceProductionConfig) ValidateProductionFields ¶ added in v0.32.0
func (p ServiceProductionConfig) ValidateProductionFields(serviceLocation, protectionLevel string) error
ValidateProductionFields validates production fields
type ServiceRemoteConfig ¶ added in v0.32.0
type ServiceRemoteConfig struct {
Dependencies map[string]RemoteDependency
Environments map[string]ServiceRemoteEnvironment
CPU string `yaml:"cpu,omitempty"`
Memory string `yaml:"memory,omitempty"`
}
ServiceRemoteConfig represents production specific configuration for an application
func (ServiceRemoteConfig) ValidateRemoteFields ¶ added in v0.32.0
func (r ServiceRemoteConfig) ValidateRemoteFields(serviceLocation, protectionLevel, remoteEnvironmentID string) error
ValidateRemoteFields validates that service.yml contiains the required fields
type ServiceRemoteEnvironment ¶ added in v0.35.0
type ServiceRemoteEnvironment struct {
EnvironmentVariables map[string]string `yaml:"environment-variables,omitempty"`
Secrets []string `yaml:",omitempty"`
URL string `yaml:"url,omitempty"`
}
ServiceRemoteEnvironment represents configuration for a particular environment
type ServiceSource ¶ added in v0.32.0
type ServiceSource struct {
Location string `yaml:",omitempty"`
DockerImage string `yaml:"docker-image,omitempty"`
DependencyData ServiceDependencyData `yaml:"dependency-data,omitempty"`
}
ServiceSource represents the service info as provided in application.yml
type ShutdownConfig ¶
ShutdownConfig represents the configuration to use when shutting down an application
type TestResult ¶ added in v0.29.0
TestResult represents the result of a test
Source Files
¶
- app_config.go
- app_remote_config.go
- app_remote_config_environment.go
- build_mode.go
- docker_compose.go
- docker_config.go
- docker_configs.go
- local_config.go
- local_dependency.go
- message_translation.go
- rds_config.go
- remote_dependency.go
- secrets.go
- service_config.go
- service_dependency_data.go
- service_development_config.go
- service_messages.go
- service_production_config.go
- service_remote_config.go
- service_remote_environment.go
- service_source.go
- shutdown_config.go
- test_result.go