Documentation
¶
Index ¶
- Constants
- Variables
- func GetComposeFileNames() []string
- type AppConfig
- type AppRemoteConfig
- type AwsConfig
- type BuildMode
- type BuildModeEnvironment
- type BuildModeType
- type DockerCompose
- type DockerConfig
- type DockerConfigs
- type EnvVars
- type LocalConfig
- type LocalDependency
- type LocalDependencyConfig
- type MessageTranslation
- type PortReservation
- type RdsConfig
- type RemoteDependency
- type RemoteDependencyConfig
- type Secrets
- type ServiceConfig
- type ServiceDevelopmentConfig
- type ServiceEndpoints
- type ServiceEnvVarNames
- type ServiceMessages
- type ServiceProductionConfig
- type ServiceRemoteConfig
- 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 DbDependencies = map[string]string{
"postgres": "rds",
"mysql": "rds",
}
DbDependencies is a map from db engines to their underlying dependency
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
Description string
Version string
Local LocalConfig `yaml:",omitempty"`
Remote AppRemoteConfig `yaml:",omitempty"`
Services map[string]ServiceSource
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) GetLocalDependencyNames ¶ added in v0.32.0
GetLocalDependencyNames returns the names of all dev dependencies listed in appConfig
func (AppConfig) GetRemoteDependencyNames ¶ added in v0.32.0
GetRemoteDependencyNames returns the names of all prod dependencies listed in appConfig
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 []RemoteDependency
URL string `yaml:",omitempty"`
Region string `yaml:",omitempty"`
AccountID string `yaml:"account-id,omitempty"`
SslCertificateArn string `yaml:"ssl-certificate-arn,omitempty"`
}
AppRemoteConfig represents production specific configuration for an application
func (AppRemoteConfig) ValidateFields ¶ added in v0.32.0
func (p AppRemoteConfig) 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 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"`
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"`
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 EnvVars ¶
type EnvVars struct {
Default map[string]string `yaml:",omitempty"`
Local map[string]string `yaml:",omitempty"`
Remote map[string]string `yaml:",omitempty"`
Secrets []string `yaml:",omitempty"`
}
EnvVars is the environment key listed in a ServiceConfig
type LocalConfig ¶ added in v0.32.0
type LocalConfig struct {
Dependencies []LocalDependency
}
LocalConfig represents development specific configuration for an application
type LocalDependency ¶ added in v0.32.0
type LocalDependency struct {
Config LocalDependencyConfig `yaml:",omitempty"`
Name string
Version string
}
LocalDependency represents a development dependency
type LocalDependencyConfig ¶ added in v0.32.0
type LocalDependencyConfig struct {
Ports []string `yaml:",omitempty"`
Persist []string `yaml:",omitempty"`
DependencyEnvironment map[string]string `yaml:"dependency-environment,omitempty"`
ServiceEnvironment map[string]string `yaml:"service-environment,omitempty"`
}
LocalDependencyConfig represents the configuration of a local dependency
type MessageTranslation ¶
MessageTranslation is the mapping from public to internal message names
type PortReservation ¶ added in v0.30.0
type PortReservation struct {
// contains filtered or unexported fields
}
PortReservation reserves a free port for services
func NewPortReservation ¶ added in v0.30.0
func NewPortReservation() *PortReservation
NewPortReservation instantiates a port reservation struct
func (*PortReservation) GetAvailablePort ¶ added in v0.30.0
func (p *PortReservation) GetAvailablePort() string
GetAvailablePort returns an available port as a string
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) 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 {
Config RemoteDependencyConfig `yaml:",omitempty"`
Name string
Version string
}
RemoteDependency represents a production dependency
func (*RemoteDependency) GetDbDependency ¶ added in v0.32.0
func (p *RemoteDependency) GetDbDependency() string
GetDbDependency returns a map of db engines to the underlying dependency
func (*RemoteDependency) ValidateFields ¶ added in v0.32.0
func (p *RemoteDependency) ValidateFields() error
ValidateFields validates that a production config contains all required fields
type RemoteDependencyConfig ¶ added in v0.32.0
type RemoteDependencyConfig struct {
Rds RdsConfig `yaml:",omitempty"`
}
RemoteDependencyConfig represents the configuration of a development dependency
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"`
ServiceMessages `yaml:"messages,omitempty"`
Docker DockerConfig `yaml:",omitempty"`
Environment EnvVars `yaml:",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) 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
func (ServiceConfig) ValidateDeployFields ¶ added in v0.32.0
func (s ServiceConfig) ValidateDeployFields(serviceLocation, protectionLevel 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 ServiceDevelopmentConfig ¶ added in v0.26.0
type ServiceDevelopmentConfig struct {
Scripts map[string]string `yaml:",omitempty"`
Port string `yaml:",omitempty"`
}
ServiceDevelopmentConfig represents development specific configuration for a service
type ServiceEndpoints ¶ added in v0.32.0
type ServiceEndpoints struct {
ServiceRole string
ServiceConfig ServiceConfig
ContainerPort string
HostPort string
BuildMode BuildMode
}
ServiceEndpoints holds the information to build an endpoint at which a service can be reached
func NewServiceEndpoint ¶ added in v0.32.0
func NewServiceEndpoint(serviceRole string, serviceConfig ServiceConfig, portReservation *PortReservation, buildMode BuildMode) *ServiceEndpoints
NewServiceEndpoint initializes a ServiceEndpoint struct
func (*ServiceEndpoints) GetEndpointMappings ¶ added in v0.32.0
func (s *ServiceEndpoints) GetEndpointMappings() map[string]string
GetEndpointMappings returns a map from env var name to env var value of a service endpoint
func (*ServiceEndpoints) GetPortMappings ¶ added in v0.32.0
func (s *ServiceEndpoints) GetPortMappings() []string
GetPortMappings returns a list of port mappings from a service's container ports to host ports
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 []RemoteDependency
Port string `yaml:"port,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 []RemoteDependency
URL string `yaml:"url,omitempty"`
CPU string `yaml:"cpu,omitempty"`
Memory string `yaml:"memory,omitempty"`
HealthCheck string `yaml:"health-check,omitempty"`
}
ServiceRemoteConfig represents production specific configuration for an application
func (ServiceRemoteConfig) ValidateRemoteFields ¶ added in v0.32.0
func (r ServiceRemoteConfig) ValidateRemoteFields(serviceLocation, protectionLevel string) error
ValidateRemoteFields validates that service.yml contiains the required fields
type ServiceSource ¶ added in v0.32.0
type ServiceSource struct {
Location string `yaml:",omitempty"`
DockerImage string `yaml:"docker-image,omitempty"`
MessageTranslations []MessageTranslation `yaml:"message-translation,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
- aws_config.go
- build_mode.go
- docker_compose.go
- docker_config.go
- docker_configs.go
- env_vars.go
- local_config.go
- local_dependency.go
- local_dependency_config.go
- message_translation.go
- port_reservation.go
- rds_config.go
- remote_dependency.go
- remote_dependency_config_options.go
- secrets.go
- service_config.go
- service_data.go
- service_development_config.go
- service_endpoints.go
- service_messages.go
- service_production_config.go
- service_remote_config.go
- shutdown_config.go
- test_result.go