types

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 11 Imported by: 11

Documentation

Index

Constants

View Source
const (
	BuildModeTypeLocal = iota
	BuildModeTypeDeploy
)

Possible values for BuildModeType

View Source
const (
	BuildModeEnvironmentTest = iota
	BuildModeEnvironmentDevelopment
	BuildModeEnvironmentProduction
)

Possible values for BuildModeEnvironment

View Source
const LocalDevelopmentComposeFileName = "run_development.yml"

LocalDevelopmentComposeFileName is the docker-compose file name for local development runs

View Source
const LocalProductionComposeFileName = "run_production.yml"

LocalProductionComposeFileName is the docker-compose file name for local production runs

View Source
const LocalTestComposeFileName = "test.yml"

LocalTestComposeFileName is the docker-compose file name for local test runs

View Source
const ServiceTypePublic = "public"

ServiceTypePublic is the value for the type field of a public service

View Source
const ServiceTypeWorker = "worker"

ServiceTypeWorker is the value for the type field of a worker service

Variables

View Source
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
	SharedDirectories []string `yaml:"shared-directories,omitempty"`
}

AppConfig represents the configuration of an application

func NewAppConfig

func NewAppConfig(appDir string) (*AppConfig, error)

NewAppConfig reads application.yml and returns the appConfig object

func (*AppConfig) AddService added in v0.36.0

func (a *AppConfig) AddService(serviceRole string)

AddService adds serviceRole to the appConfig object

func (*AppConfig) GetSortedServiceRoles added in v0.28.0

func (a *AppConfig) GetSortedServiceRoles() []string

GetSortedServiceRoles returns the service roles listed in application.yml sorted alphabetically

func (*AppConfig) VerifyServiceRoleDoesNotExist added in v0.28.0

func (a *AppConfig) VerifyServiceRoleDoesNotExist(serviceRole string) error

VerifyServiceRoleDoesNotExist returns an error if the serviceRole already exists in existingServices, and return nil otherwise.

func (*AppConfig) Write added in v0.36.0

func (a *AppConfig) Write(location string) error

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

func (b BuildMode) GetDockerComposeFileName() string

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

type MessageTranslation struct {
	Public   string `yaml:"public"`
	Internal string `yaml:"internal"`
}

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

func (d *RdsConfig) ValidateFields() error

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

type Secrets map[string]string

Secrets map contains maps from secret keys to values

func (Secrets) Delete

func (s Secrets) Delete(toDelete []string) Secrets

Delete deletes secrets from s. Ignores them if they do not exist

func (Secrets) Keys

func (s Secrets) Keys() []string

Keys returns all the keys for a secrets map

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

type ServiceDependencyData map[string]map[string]interface{}

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

type ServiceMessages struct {
	Receives []string
	Sends    []string
}

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

type ShutdownConfig struct {
	CloseMessage string
	ErrorMessage string
}

ShutdownConfig represents the configuration to use when shutting down an application

type TestResult added in v0.29.0

type TestResult struct {
	Passed      bool
	Interrupted bool
}

TestResult represents the result of a test

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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