common

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

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

List of valid stack types

Variables

This section is empty.

Functions

func CreateStackName

func CreateStackName(stackType StackType, names ...string) string

CreateStackName will create a name for a stack

func GetVersion

func GetVersion() string

GetVersion returns the current version of the app

func SetVersion added in v0.1.3

func SetVersion(v string)

SetVersion 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
	RepositoryAuthenticator
}

ClusterManager composite of all cluster capabilities

type Config

type Config struct {
	Basedir      string
	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
	Repo   struct {
		Name     string
		Revision string
	}
	StackManager   StackManager
	ClusterManager ClusterManager
	DockerManager  DockerManager
}

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

func (*Context) InitializeFromFile added in v0.1.3

func (ctx *Context) InitializeFromFile(muFile string) error

InitializeFromFile loads config from file

type DockerImageBuilder added in v0.1.3

type DockerImageBuilder interface {
	ImageBuild(contextDir string, relDockerfile string, tags []string, dockerOut io.Writer) error
}

DockerImageBuilder for creating docker images

type DockerImagePusher added in v0.1.3

type DockerImagePusher interface {
	ImagePush(image string, registryAuth string, dockerOut io.Writer) error
}

DockerImagePusher for pushing docker images

type DockerManager added in v0.1.3

type DockerManager interface {
	DockerImageBuilder
	DockerImagePusher
}

DockerManager composite of all cluster capabilities

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 RepositoryAuthenticator added in v0.1.3

type RepositoryAuthenticator interface {
	AuthenticateRepository(repoURL string) (string, error)
}

RepositoryAuthenticator auths for a repo

type Service

type Service struct {
	Name            string   `yaml:"name"`
	DesiredCount    int      `yaml:"desiredCount"`
	Dockerfile      string   `yaml:"dockerfile"`
	ImageRepository string   `yaml:"imageRepository"`
	Port            int      `yaml:"port"`
	HealthEndpoint  string   `yaml:"healthEndpoint"`
	CPU             int      `yaml:"cpu"`
	Memory          int      `yaml:"memory"`
	PathPatterns    []string `yaml:"pathPatterns"`
	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
	LastUpdateTime time.Time
	Tags           map[string]string
	Outputs        map[string]string
	Parameters     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) *Stack
}

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