common

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StackTypeVpc      StackType = "vpc"
	StackTypeCluster            = "cluster"
	StackTypeService            = "service"
	StackTypePipeline           = "pipeline"
)

List of valid stack types

Variables

This section is empty.

Functions

func CreateStackName

func CreateStackName(stackType StackType, name string) string

CreateStackName will create a name for a stack

func GetVersion

func GetVersion() string

GetVersion returns the current version of the app

func SetupLogging

func SetupLogging(verbosity int)

SetupLogging - verbosity 0=error, 1=info, 2=debug

Types

type ClusterInstanceLister

type ClusterInstanceLister interface {
	ListInstances(clusterName string) ([]*ecs.ContainerInstance, error)
}

ClusterInstanceLister for getting cluster instances

type ClusterManager

type ClusterManager interface {
	ClusterInstanceLister
}

ClusterManager composite of all cluster capabilities

type Config

type Config struct {
	Region       string
	Environments []Environment
	Service      Service
}

Config defines the structure of the yml file for the mu config

type Context

type Context struct {
	Config         Config
	StackManager   StackManager
	ClusterManager ClusterManager
}

Context defines the context object passed around

func NewContext

func NewContext() *Context

NewContext create a new context object

func (*Context) Initialize

func (ctx *Context) Initialize(configReader io.Reader) error

Initialize loads config object

type Environment

type Environment struct {
	Name         string
	Loadbalancer struct {
		Hostname string
	}
	Cluster struct {
		ImageID           string `yaml:"imageId"`
		InstanceTenancy   string `yaml:"instanceTenancy"`
		DesiredCapacity   int    `yaml:"desiredCapacity"`
		MaxSize           int    `yaml:"maxSize"`
		KeyName           string `yaml:"keyName"`
		SSHAllow          string `yaml:"sshAllow"`
		ScaleOutThreshold int    `yaml:"scaleOutThreshold"`
		ScaleInThreshold  int    `yaml:"scaleInThreshold"`
	}
	VpcTarget struct {
		VpcID           string   `yaml:"vpcId"`
		PublicSubnetIds []string `yaml:"publicSubnetIds"`
	} `yaml:"vpcTarget,omitempty"`
}

Environment defines the structure of the yml file for an environment

type ImageFinder

type ImageFinder interface {
	FindLatestImageID(namePattern string) (string, error)
}

ImageFinder for finding latest image

type Service

type Service struct {
	DesiredCount int `yaml:"desiredCount"`
	Pipeline     struct {
	}
}

Service defines the structure of the yml file for a service

type Stack

type Stack struct {
	ID           string
	Name         string
	Status       string
	StatusReason string
	Tags         map[string]string
	Outputs      map[string]string
}

Stack summary

type StackDeleter

type StackDeleter interface {
	DeleteStack(stackName string) error
}

StackDeleter for deleting stacks

type StackGetter

type StackGetter interface {
	GetStack(stackName string) (*Stack, error)
}

StackGetter for getting stacks

type StackLister

type StackLister interface {
	ListStacks(stackType StackType) ([]*Stack, error)
}

StackLister for listing stacks

type StackManager

StackManager composite of all stack capabilities

type StackType

type StackType string

StackType describes supported stack types

type StackUpserter

type StackUpserter interface {
	UpsertStack(stackName string, templateBodyReader io.Reader, parameters map[string]string, tags map[string]string) error
}

StackUpserter for applying changes to a stack

type StackWaiter

type StackWaiter interface {
	AwaitFinalStatus(stackName string) string
}

StackWaiter for waiting on stack status to be final

Jump to

Keyboard shortcuts

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