Documentation
¶
Index ¶
- Variables
- func AppDockerLogin(app App) (string, error)
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func AutoScaling() *autoscaling.AutoScaling
- func AwsCamelize(dasherized string) string
- func CFParams(source map[string]string) map[string]string
- func CloudFormation() *cloudformation.CloudFormation
- func CloudWatch() *cloudwatch.CloudWatch
- func CloudWatchLogs() *cloudwatchlogs.CloudWatchLogs
- func DashName(name string) string
- func DescribeStack(name string) (*cloudformation.DescribeStacksOutput, error)
- func DescribeStacks() (*cloudformation.DescribeStacksOutput, error)
- func Docker(host string) (*docker.Client, error)
- func DockerHost() (string, error)
- func DockerLogin(ac docker.AuthConfiguration) (string, error)
- func DockerLogout(ac docker.AuthConfiguration) error
- func DynamoDB() *dynamodb.DynamoDB
- func EC2() *ec2.EC2
- func ECR() *ecr.ECR
- func ECS() *ecs.ECS
- func ELB() *elb.ELB
- func GetAppServices(app string) ([]*ecs.Service, error)
- func IAM() *iam.IAM
- func IndexUpload(hash string, data []byte) error
- func InstanceKeyroll() error
- func InstanceSSH(id, command, term string, height, width int, rw io.ReadWriter) error
- func Kinesis() *kinesis.Kinesis
- func LoginPrivateRegistries() error
- func MustAsset(name string) []byte
- func Notify(name, status string, data map[string]string) error
- func NotifyError(action string, err error, data map[string]string) error
- func NotifySuccess(action string, data map[string]string) error
- func PullAppImages()
- func PutEnvironment(app string, env Environment) (string, error)
- func PutRackSettings(env Environment) error
- func RDS() *rds.RDS
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func S3() *s3.S3
- func S3Put(bucket, key string, data []byte, public bool) error
- func S3PutFile(bucket, key string, f io.ReadSeeker, public bool) error
- func SNS() *sns.SNS
- func SQS() *sqs.SQS
- func SetFormation(app, process string, count, memory int64) error
- func SettingGet(name string) (string, error)
- func SettingSet(name, value string) error
- func UpdateStack(req *cloudformation.UpdateStackInput) (*cloudformation.UpdateStackOutput, error)
- func UpperName(name string) string
- type App
- func (a *App) BalancerHost() string
- func (a *App) BalancerPorts(ps string) map[string]string
- func (a *App) Cleanup() error
- func (a *App) Create() error
- func (a *App) Delete() error
- func (a *App) ExecAttached(pid, command string, height, width int, rw io.ReadWriter) error
- func (a *App) ForkRelease() (*Release, error)
- func (a *App) Formation() (string, error)
- func (a *App) IsBound() bool
- func (a *App) LatestRelease() (*Release, error)
- func (a *App) ProcessPorts(ps string) map[string]string
- func (a *App) Resources() (Resources, error)
- func (a *App) RunAttached(process, command string, height, width int, rw io.ReadWriter) error
- func (a *App) RunDetached(process, command string) error
- func (a *App) StackName() string
- func (a *App) SubscribeLogs(output chan []byte, quit chan bool) error
- func (a *App) TaskDefinitionFamily() string
- func (a *App) UpdateParams(changes map[string]string) error
- type Apps
- type Build
- func (b *Build) Cleanup() error
- func (srcBuild *Build) CopyTo(destApp App) (*Build, error)
- func (b *Build) ExecuteIndex(index Index, cache bool, manifest string, ch chan error)
- func (b *Build) ExecuteLocal(r io.Reader, cache bool, manifest string, ch chan error)
- func (b *Build) ExecuteRemote(repo string, cache bool, manifest string, ch chan error)
- func (b *Build) Fail(err error)
- func (b *Build) IsRunning() bool
- func (b *Build) Save() error
- type Builds
- type CfsslCertificateBundle
- type Deployment
- type Deployments
- type DescribeStacksResult
- type ECSEvents
- type ECSServices
- type Environment
- type Formation
- type FormationEntry
- type Index
- type IndexItem
- type Manifest
- func (m Manifest) BalancerResourceName(process string) string
- func (m Manifest) Balancers() []ManifestBalancer
- func (m Manifest) Entry(name string) *ManifestEntry
- func (m Manifest) EntryNames() []string
- func (m Manifest) Formation() (string, error)
- func (m Manifest) GetBalancer(name string) *ManifestBalancer
- func (m Manifest) HasExternalPorts() bool
- func (m Manifest) HasProcesses() bool
- type ManifestBalancer
- func (mb ManifestBalancer) ExternalPorts() []string
- func (mb ManifestBalancer) FirstPort() string
- func (mb ManifestBalancer) InternalPorts() []string
- func (mb ManifestBalancer) LoadBalancerName() template.HTML
- func (mb ManifestBalancer) PortMappings() []ManifestPort
- func (mb ManifestBalancer) Ports() []string
- func (mb ManifestBalancer) ProcessName() string
- func (mb ManifestBalancer) Randoms() map[string]int
- func (mb ManifestBalancer) ResourceName() string
- func (mb ManifestBalancer) Scheme() string
- type ManifestEntries
- type ManifestEntry
- func (me *ManifestEntry) BalancerResourceName() string
- func (me *ManifestEntry) CommandString() string
- func (me ManifestEntry) ContainerPorts() []string
- func (me ManifestEntry) EnvMap() map[string]string
- func (me ManifestEntry) ExternalPorts() []string
- func (me ManifestEntry) HasBalancer() bool
- func (me ManifestEntry) InternalPorts() []string
- func (me ManifestEntry) MountableVolumes() []string
- func (me ManifestEntry) PortMappings() []ManifestPort
- func (me ManifestEntry) Randoms() map[string]int
- func (me ManifestEntry) RegistryImage(app *App, buildId string) string
- type ManifestPort
- type Metrics
- type Process
- type Processes
- type Release
- type Releases
- type Resource
- type Resources
- type SSL
- type SSLs
- type Service
- func (s *Service) Create() error
- func (s *Service) CreateDatastore() (*cloudformation.CreateStackInput, error)
- func (s *Service) CreatePapertrail() (*cloudformation.CreateStackInput, error)
- func (s *Service) CreateS3() (*cloudformation.CreateStackInput, error)
- func (s *Service) CreateSNS() (*cloudformation.CreateStackInput, error)
- func (s *Service) CreateSQS() (*cloudformation.CreateStackInput, error)
- func (s *Service) CreateWebhook() (*cloudformation.CreateStackInput, error)
- func (s *Service) Delete() error
- func (s *Service) Formation() (string, error)
- func (s *Service) IsBound() bool
- func (s *Service) LinkPapertrail(app App) error
- func (s *Service) StackName() string
- func (s *Service) SubscribeLogs(output chan []byte, quit chan bool) error
- func (s *Service) UnlinkPapertrail(app App) error
- func (s *Service) Update(changes map[string]string) error
- func (s *Service) UpdateDatastore() (*cloudformation.UpdateStackInput, error)
- func (s *Service) UpdateIAMService() (*cloudformation.UpdateStackInput, error)
- func (s *Service) UpdatePapertrail(arns map[string]string) error
- type Services
- type Template
- type TemplateParameter
- type Transaction
- type Transactions
Constants ¶
This section is empty.
Variables ¶
var CustomTopic = os.Getenv("CUSTOM_TOPIC")
var DEPLOYMENT_TIMEOUT = 10 * time.Minute
var DescribeStacksCache = map[string]DescribeStacksResult{}
var DescribeStacksCacheTTL = 5 * time.Second
var DescribeStacksMutex = &sync.Mutex{}
var ErrPending = errors.New("can not get docker client for non-running container")
var (
IndexOperationConcurrency = 128
)
var ManifestRandomPorts = true
set to false when testing for deterministic ports
var NotificationHost = os.Getenv("NOTIFICATION_HOST")
var NotificationTopic = os.Getenv("NOTIFICATION_TOPIC")
var PauseNotifications = false
var SortableTime = "20060102.150405.000000000"
var StatusCodePrefix = client.StatusCodePrefix
Functions ¶
func AppDockerLogin ¶
Log into the appropriate registry for the given app This could be the self-hosted v1 registry or an ECR registry
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AutoScaling ¶
func AutoScaling() *autoscaling.AutoScaling
func AwsCamelize ¶
func CFParams ¶
turns a dasherized map of key/value CLI params to parameters that CloudFormation expects
func CloudFormation ¶
func CloudFormation() *cloudformation.CloudFormation
func CloudWatch ¶
func CloudWatch() *cloudwatch.CloudWatch
func CloudWatchLogs ¶
func CloudWatchLogs() *cloudwatchlogs.CloudWatchLogs
func DescribeStack ¶
func DescribeStack(name string) (*cloudformation.DescribeStacksOutput, error)
func DescribeStacks ¶
func DescribeStacks() (*cloudformation.DescribeStacksOutput, error)
func DockerHost ¶
func DockerLogin ¶
func DockerLogout ¶
func DockerLogout(ac docker.AuthConfiguration) error
func IndexUpload ¶
func InstanceKeyroll ¶
func InstanceKeyroll() error
func InstanceSSH ¶
func InstanceSSH(id, command, term string, height, width int, rw io.ReadWriter) error
func LoginPrivateRegistries ¶
func LoginPrivateRegistries() error
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NotifyError ¶
uniform error handling
func PullAppImages ¶
func PullAppImages()
func PutEnvironment ¶
func PutEnvironment(app string, env Environment) (string, error)
func PutRackSettings ¶
func PutRackSettings(env Environment) error
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func SetFormation ¶
Update Process Parameters for Count and Memory Expects -1 for count or memory to indicate no change, since count=0 is valid
func SettingGet ¶
func SettingSet ¶
func UpdateStack ¶
func UpdateStack(req *cloudformation.UpdateStackInput) (*cloudformation.UpdateStackOutput, error)
Types ¶
type App ¶
type App struct {
Name string `json:"name"`
Release string `json:"release"`
Status string `json:"status"`
Outputs map[string]string `json:"-"`
Parameters map[string]string `json:"-"`
Tags map[string]string `json:"-"`
}
func GetAppBound ¶
func GetAppUnbound ¶
func (*App) BalancerHost ¶
func (*App) ExecAttached ¶
func (*App) ForkRelease ¶
func (*App) LatestRelease ¶
func (*App) RunAttached ¶
func (*App) RunDetached ¶
func (*App) SubscribeLogs ¶
During the transition from Kinesis to CloudWatch Logs, apps might not have been re-deployed and provisioned a LogGroup. Conditionally fall back to reading from Kinesis in this case.
func (*App) TaskDefinitionFamily ¶
type Build ¶
type Build struct {
Id string `json:"id"`
App string `json:"app"`
Logs string `json:"logs"`
Manifest string `json:"manifest"`
Release string `json:"release"`
Status string `json:"status"`
Description string `json:"description"`
Started time.Time `json:"started"`
Ended time.Time `json:"ended"`
// contains filtered or unexported fields
}
func (*Build) ExecuteIndex ¶
func (*Build) ExecuteLocal ¶
func (*Build) ExecuteRemote ¶
func (*Build) IsRunning ¶
Test if another build container is running. This is a temporary workaround since the current Docker Registry does not handle pushing multiple images at the same time. Course grained locking will prevent subtle build errors until a better registry and/or Docker image subsystem is integrated
type CfsslCertificateBundle ¶
type CfsslCertificateBundle struct {
Bundle string `json:"bundle"`
}
type Deployment ¶
type Deployments ¶
type Deployments []Deployment
func ListDeployments ¶
func ListDeployments(app string) (Deployments, error)
type DescribeStacksResult ¶
type DescribeStacksResult struct {
Name string
Output *cloudformation.DescribeStacksOutput
RequestTime time.Time
}
type ECSEvents ¶
type ECSEvents []*ecs.ServiceEvent
func (ECSEvents) CapacityWarning ¶
func (ECSEvents) HasCapacityWarning ¶
type ECSServices ¶
func ClusterServices ¶
func ClusterServices() (ECSServices, error)
func (ECSServices) EventsSince ¶
func (services ECSServices) EventsSince(since time.Time) ECSEvents
func (ECSServices) IsConverged ¶
func (services ECSServices) IsConverged() bool
func (ECSServices) LastEvent ¶
func (services ECSServices) LastEvent() ecs.ServiceEvent
type Environment ¶
func GetEnvironment ¶
func GetEnvironment(app string) (Environment, error)
func GetPrivateRegistriesAuth ¶
func GetPrivateRegistriesAuth() (Environment, docker.AuthConfigurations119, error)
func GetRackSettings ¶
func GetRackSettings() (Environment, error)
Use the Rack Settings bucket and EncryptionKey KMS key to store and retrieve sensitive credentials, just like app env
func LoadEnvironment ¶
func LoadEnvironment(data []byte) Environment
func (Environment) Raw ¶
func (e Environment) Raw() string
func (Environment) SortedNames ¶
func (e Environment) SortedNames() []string
type Formation ¶
type Formation []FormationEntry
func ListFormation ¶
func (Formation) Entry ¶
func (f Formation) Entry(name string) *FormationEntry
type FormationEntry ¶
type Manifest ¶
type Manifest []ManifestEntry
func (Manifest) BalancerResourceName ¶
func (Manifest) Balancers ¶
func (m Manifest) Balancers() []ManifestBalancer
func (Manifest) Entry ¶
func (m Manifest) Entry(name string) *ManifestEntry
func (Manifest) EntryNames ¶
func (Manifest) GetBalancer ¶
func (m Manifest) GetBalancer(name string) *ManifestBalancer
func (Manifest) HasExternalPorts ¶
func (Manifest) HasProcesses ¶
type ManifestBalancer ¶
type ManifestBalancer struct {
Entry ManifestEntry
Public bool
}
func (ManifestBalancer) ExternalPorts ¶
func (mb ManifestBalancer) ExternalPorts() []string
func (ManifestBalancer) FirstPort ¶
func (mb ManifestBalancer) FirstPort() string
func (ManifestBalancer) InternalPorts ¶
func (mb ManifestBalancer) InternalPorts() []string
func (ManifestBalancer) LoadBalancerName ¶
func (mb ManifestBalancer) LoadBalancerName() template.HTML
func (ManifestBalancer) PortMappings ¶
func (mb ManifestBalancer) PortMappings() []ManifestPort
func (ManifestBalancer) Ports ¶
func (mb ManifestBalancer) Ports() []string
func (ManifestBalancer) ProcessName ¶
func (mb ManifestBalancer) ProcessName() string
func (ManifestBalancer) Randoms ¶
func (mb ManifestBalancer) Randoms() map[string]int
func (ManifestBalancer) ResourceName ¶
func (mb ManifestBalancer) ResourceName() string
func (ManifestBalancer) Scheme ¶
func (mb ManifestBalancer) Scheme() string
type ManifestEntries ¶
type ManifestEntries map[string]ManifestEntry
type ManifestEntry ¶
type ManifestEntry struct {
Name string
Build string `yaml:"build"`
Command interface{} `yaml:"command"`
Env []string `yaml:"environment"`
Exports map[string]string `yaml:"-"`
Image string `yaml:"image"`
Links []string `yaml:"links"`
LinkVars map[string]template.HTML `yaml:"-"`
Ports []string `yaml:"ports"`
Privileged bool `yaml:"privileged"`
Volumes []string `yaml:"volumes"`
// contains filtered or unexported fields
}
func (*ManifestEntry) BalancerResourceName ¶
func (me *ManifestEntry) BalancerResourceName() string
func (*ManifestEntry) CommandString ¶
func (me *ManifestEntry) CommandString() string
func (ManifestEntry) ContainerPorts ¶
func (me ManifestEntry) ContainerPorts() []string
func (ManifestEntry) EnvMap ¶
func (me ManifestEntry) EnvMap() map[string]string
func (ManifestEntry) ExternalPorts ¶
func (me ManifestEntry) ExternalPorts() []string
func (ManifestEntry) HasBalancer ¶
func (me ManifestEntry) HasBalancer() bool
func (ManifestEntry) InternalPorts ¶
func (me ManifestEntry) InternalPorts() []string
func (ManifestEntry) MountableVolumes ¶
func (me ManifestEntry) MountableVolumes() []string
func (ManifestEntry) PortMappings ¶
func (me ManifestEntry) PortMappings() []ManifestPort
func (ManifestEntry) Randoms ¶
func (me ManifestEntry) Randoms() map[string]int
func (ManifestEntry) RegistryImage ¶
func (me ManifestEntry) RegistryImage(app *App, buildId string) string
type ManifestPort ¶
type Process ¶
type Process struct {
Id string `json:"id"`
App string `json:"app"`
Command string `json:"command"`
Host string `json:"host"`
Image string `json:"image"`
Name string `json:"name"`
Ports []string `json:"ports"`
Release string `json:"release"`
Size int64 `json:"size"`
Cpu float64 `json:"cpu"`
Memory float64 `json:"memory"`
Started time.Time `json:"started"`
// contains filtered or unexported fields
}
func GetProcess ¶
func ListPendingProcesses ¶
func ListProcesses ¶
func (*Process) FetchStats ¶
type Processes ¶
type Processes []*Process
func ListOneoffProcesses ¶
type Release ¶
type Release struct {
Id string `json:"id"`
App string `json:"app"`
Build string `json:"build"`
Env string `json:"env"`
Manifest string `json:"manifest"`
Created time.Time `json:"created"`
}
func GetRelease ¶
func NewRelease ¶
func (*Release) EnvironmentUrl ¶
type Resources ¶
func ListResources ¶
type SSL ¶
type SSL struct {
Expiration time.Time `json:"expiration"`
Domain string `json:"domain"`
Process string `json:"process"`
Port int `json:"port"`
Secure bool `json:"secure"`
}
type Service ¶
func GetService ¶
func GetServiceBound ¶
func GetServiceUnbound ¶
func (*Service) CreateDatastore ¶
func (s *Service) CreateDatastore() (*cloudformation.CreateStackInput, error)
func (*Service) CreatePapertrail ¶
func (s *Service) CreatePapertrail() (*cloudformation.CreateStackInput, error)
func (*Service) CreateS3 ¶
func (s *Service) CreateS3() (*cloudformation.CreateStackInput, error)
func (*Service) CreateSNS ¶
func (s *Service) CreateSNS() (*cloudformation.CreateStackInput, error)
func (*Service) CreateSQS ¶
func (s *Service) CreateSQS() (*cloudformation.CreateStackInput, error)
func (*Service) CreateWebhook ¶
func (s *Service) CreateWebhook() (*cloudformation.CreateStackInput, error)
func (*Service) LinkPapertrail ¶
func (*Service) SubscribeLogs ¶
func (*Service) UnlinkPapertrail ¶
func (*Service) Update ¶
Service Update takes a map of CF Parameter changes and applies on top of the existing parameters and the newest template. The CLI / Client / Server delegates everything to CloudFormation, and makes no guarantees of service uptime during update. In fact, most datastore updates guarantee resource replacement which will cause database downtime.
func (*Service) UpdateDatastore ¶
func (s *Service) UpdateDatastore() (*cloudformation.UpdateStackInput, error)
func (*Service) UpdateIAMService ¶
func (s *Service) UpdateIAMService() (*cloudformation.UpdateStackInput, error)
S3, SNS, SQS create an IAM user, therefore require IAM capabilitites for updates
type Template ¶
type Template struct {
Parameters map[string]TemplateParameter
}
type TemplateParameter ¶
type Transaction ¶
A Transaction groups more than one event on a Name/Type resource
type Transactions ¶
type Transactions []Transaction
func (Transactions) Len ¶
func (slice Transactions) Len() int
func (Transactions) Less ¶
func (slice Transactions) Less(i, j int) bool
func (Transactions) Swap ¶
func (slice Transactions) Swap(i, j int)
Source Files
¶
- app.go
- build.go
- cluster.go
- deployment.go
- docker.go
- environment.go
- formation.go
- helpers.go
- index.go
- instances.go
- logs.go
- manifest.go
- metrics.go
- models.go
- notify.go
- process.go
- release.go
- resource.go
- service-datastore.go
- service-papertrail.go
- service-s3.go
- service-sns.go
- service-sqs.go
- service-webhook.go
- service.go
- settings.go
- ssl.go
- system.go
- templates.go
- transaction.go