empire

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2015 License: BSD-2-Clause Imports: 38 Imported by: 67

README

Empire

Install

readthedocs badge Circle CI

Empire is a control layer on top of Amazon EC2 Container Service (ECS) that provides a Heroku like workflow. It conforms to a subset of the Heroku Platform API, which means you can use the same tools and processes that you use with Heroku, but with all the power of EC2 and Docker.

Empire is targeted at small to medium sized startups that are running a large number of microservices and need more flexibility than what Heroku provides. You can read the original blog post about why we built empire on the Remind engineering blog.

Quickstart

To use Empire, you'll need to have an ECS cluster running. See the quickstart guide for more information.

Architecture

Empire aims to make it trivially easy to deploy a container based microservices architecture, without all of the complexities of managing systems like Mesos or Kubernetes. ECS takes care of much of that work, but Empire attempts to enhance the interface to ECS for deploying and maintaining applications, allowing you to deploy Docker images as easily as:

$ emp deploy remind101/acme-inc:latest
Heroku API compatibility

Empire supports a subset of the Heroku Platform API, which means any tool that uses the Heroku API can probably be used with Empire, if the endpoint is supported.

As an example, you can use the hk CLI with Empire like this:

$ HEROKU_API_URL=<empire_url> hk ...

However, the best user experience will be by using the emp command, which is a fork of hk with Empire specific features.

Routing

Empire's routing layer is backed by internal ELBs. Any application that specifies a web process will get an internal ELB attached to its associated ECS Service. When a new version of the app is deployed, ECS manages spinning up the new versions of the process, waiting for old connections to drain, then killing the old release.

When a new internal ELB is created, an associated CNAME record will be created in Route53 under the internal TLD, which means you can use DNS for service discovery. If we deploy an app named feed then it will be available at http://feed within the ECS cluster.

Apps default to only being exposed internally, unless you add a custom domain to them. Adding a custom domain will create a new external ELB for the ECS service.

Deploying

Any tagged Docker image can be deployed to Empire as an app. Empire doesn't enforce how you tag your Docker images, but we recommend tagging the image with the git sha that it was built from, and deploying that. We have a tool for performing deployments called Tugboat that supports deploying Docker images to Empire.

When you deploy a Docker image to Empire, it will extract a Procfile from the WORKDIR. Like Heroku, you can specify different process types that compose your service (e.g. web and worker), and scale them individually. Each process type in the Procfile maps directly to an ECS Service.

Caveats

Because docker run does not exec commands within a shell, commands specified within the Procfile will also not be exec'd within a shell. This means that you cannot specify environment variables in the Procfile. The following is not valid:

web: acme-inc server -port=$PORT

If you need to specify environment variables as part of the command, we recommend splitting out your Procfile commands into small bash shims instead:

web: ./bin/web
#!/bin/bash

set -e

exec acme-inc server -port=$PORT

Tests

Unit tests live alongside each go file as _test.go.

There is also a tests directory that contains integration and functional tests that tests the system using the heroku-go client and the emp command.

To get started, run:

$ make bootstrap

The bootstrap command assumes you have a running postgres server. It will create a database called empire using the postgres client connection defaults.

To run the tests:

$ godep go test ./...

Development

If you want to contribute to Empire, you may end up wanting to run a local instance against an ECS cluster. Doing this is relatively easy:

  1. Ensure that you have the AWS CLI installed and configured.

  2. Ensure that you accepted the terms and conditions for the official ECS AMI:

    https://aws.amazon.com/marketplace/ordering?productId=4ce33fd9-63ff-4f35-8d3a-939b641f1931&ref_=dtl_psb_continue&region=us-east-1

    Also check that the offical ECS AMI ID for US East matches with the one in cloudformation.json: https://github.com/remind101/empire/blob/master/docs/cloudformation.json#L20

  3. Run docker-machine and export the environment variables so Empire can connect:

    $ docker-machine start default
    $ eval "$(docker-machine env default)"
    
  4. Run the bootstrap script, which will create a cloudformation stack, ecs cluster and populate a .env file:

    $ DEMOMODE=0 ./bin/bootstrap
    
  5. Run Empire with docker-compose:

    $ docker-compose up
    

    NOTE: You might need to run this twice the first time you start it up, to give the postgres container time to initialize.

  6. Install the emp CLI.

    $ go get -u github.com/remind101/emp
    

Empire will be available at http://$(docker-machine ip default):8080 and you can point the CLI there.

$ export EMPIRE_API_URL=http://$(docker-machine ip default):8080
$ emp deploy remind101/acme-inc

Community

We have a google group, empire-dev, where you can ask questions and engage with the Empire community.

Documentation

Index

Constants

View Source
const (
	ExposePrivate = "private"
	ExposePublic  = "public"
)
View Source
const (
	StatusPending = "pending"
	StatusFailed  = "failed"
	StatusSuccess = "success"
)

Deployment statuses.

View Source
const (
	// WebPort is the default PORT to set on web processes.
	WebPort = 8080

	// WebProcessType is the process type we assume are web server processes.
	WebProcessType = "web"
)
View Source
const (
	UserKey key = 0
)

Variables

View Source
var (
	ErrDomainInUse        = errors.New("Domain currently in use by another app.")
	ErrDomainAlreadyAdded = errors.New("Domain already added to this app.")
	ErrDomainNotFound     = errors.New("Domain could not be found.")
)
View Source
var (
	// DefaultOptions is a default Options instance that can be passed when
	// intializing a new Empire.
	DefaultOptions = Options{}

	// DefaultReporter is the default reporter.Reporter to use.
	DefaultReporter = reporter.NewLogReporter()
)
View Source
var (
	Constraints1X = Constraints{constraints.CPUShare(256), constraints.Memory(512 * MB)}
	Constraints2X = Constraints{constraints.CPUShare(512), constraints.Memory(1 * GB)}
	ConstraintsPX = Constraints{constraints.CPUShare(1024), constraints.Memory(6 * GB)}

	// NamedConstraints maps a heroku dynos size to a Constraints.
	NamedConstraints = map[string]Constraints{
		"1X": Constraints1X,
		"2X": Constraints2X,
		"PX": ConstraintsPX,
	}

	// DefaultConstraints defaults to 1X process size.
	DefaultConstraints = Constraints1X
)
View Source
var All = ScopeFunc(func(db *gorm.DB) *gorm.DB {
	return db
})

All returns a scope that simply returns the db.

View Source
var DefaultQuantities = ProcessQuantityMap{
	"web": 1,
}

DefaultQuantities maps a process type to the default number of instances to run.

View Source
var (
	// ErrInvalidName is used to indicate that the app name is not valid.
	ErrInvalidName = &ValidationError{
		errors.New("An app name must be alphanumeric and dashes only, 3-30 chars in length."),
	}
)
View Source
var ErrNoPorts = errors.New("no ports avaiable")
View Source
var NamePattern = regexp.MustCompile(`^[a-z][a-z0-9-]{2,30}$`)

NamePattern is a regex pattern that app names must conform to.

View Source
var (
	// Procfile is the name of the Procfile file.
	Procfile = "Procfile"
)

Functions

func AppID

func AppID(id string) func(*gorm.DB) *gorm.DB

AppID returns a scope to find an app by id.

func AppNameFromRepo

func AppNameFromRepo(repo string) string

AppNameFromRepo generates a name from a Repo

remind101/r101-api => r101-api

func FakeDockerPull

func FakeDockerPull(img image.Image, w io.Writer) error

FakeDockerPull returns a slice of events that look like a docker pull.

func Migrate

func Migrate(db, path string) ([]error, bool)

Migrate runs the migrations.

func SignToken

func SignToken(secret []byte, token *AccessToken) (string, error)

SignToken jwt signs the token and adds the signature to the Token field.

func WithUser

func WithUser(ctx context.Context, u *User) context.Context

WithUser adds a user to the context.Context.

Types

type AccessToken

type AccessToken struct {
	Token string
	User  *User
}

AccessToken represents a token that allow access to the api.

func ParseToken

func ParseToken(secret []byte, token string) (*AccessToken, error)

ParseToken parses a string token, verifies it, and returns an AccessToken instance.

type App

type App struct {
	ID string

	Name string

	Repo *string

	Certificates []*Certificate

	// Valid values are empire.ExposePrivate and empire.ExposePublic.
	Exposure string

	CreatedAt *time.Time
}

App represents an app.

func (*App) BeforeCreate

func (a *App) BeforeCreate() error

func (*App) IsValid

func (a *App) IsValid() error

IsValid returns an error if the app isn't valid.

type AppsQuery

type AppsQuery struct {
	// If provided, an App ID to find.
	ID *string

	// If provided, finds apps matching the given name.
	Name *string

	// If provided, finds apps with the given repo attached.
	Repo *string
}

AppsQuery is a Scope implementation for common things to filter releases by.

func (AppsQuery) Scope

func (q AppsQuery) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type Certificate

type Certificate struct {
	ID               string
	Name             string
	CertificateChain string
	PrivateKey       string `sql:"-"`
	CreatedAt        *time.Time
	UpdatedAt        *time.Time

	AppID string
	App   *App
}

func (*Certificate) BeforeCreate

func (c *Certificate) BeforeCreate() error

PreInsert implements a pre insert hook for the db interface

func (*Certificate) BeforeUpdate

func (c *Certificate) BeforeUpdate() error

PreUpdate implements a pre insert hook for the db interface

type CertificatesQuery

type CertificatesQuery struct {
	// If provided, finds the certificate with the given id.
	ID *string

	// If provided, filters certificates belong to the given app.
	App *App
}

CertificatesQuery is a Scope implementation for common things to filter certificates by.

func (CertificatesQuery) Scope

func (q CertificatesQuery) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type Command

type Command string

Command represents the actual shell command that gets executed for a given ProcessType.

func (*Command) Scan

func (c *Command) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (Command) Value

func (c Command) Value() (driver.Value, error)

Value implements the driver.Value interface.

type CommandMap

type CommandMap map[ProcessType]Command

CommandMap maps a process ProcessType to a Command.

func ParseProcfile

func ParseProcfile(b []byte) (CommandMap, error)

ParseProcfile takes a byte slice representing a YAML Procfile and parses it into a processes.CommandMap.

func (*CommandMap) Scan

func (cm *CommandMap) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (CommandMap) Value

func (cm CommandMap) Value() (driver.Value, error)

Value implements the driver.Value interface.

type ComposedScope

type ComposedScope []Scope

ComposedScope is an implementation of the Scope interface that chains the scopes together.

func (ComposedScope) Scope

func (s ComposedScope) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type Config

type Config struct {
	ID   string
	Vars Vars

	AppID string
	App   *App
}

Config represents a collection of environment variables.

func NewConfig

func NewConfig(old *Config, vars Vars) *Config

NewConfig initializes a new config based on the old config, with the new variables provided.

type ConfigsQuery

type ConfigsQuery struct {
	// If provided, returns finds the config with the given id.
	ID *string

	// If provided, filters configs for the given app.
	App *App
}

ConfigsQuery is a Scope implementation for common things to filter releases by.

func (ConfigsQuery) Scope

func (q ConfigsQuery) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type Constraints

type Constraints constraints.Constraints

Constraints aliases constraints.Constraints to implement the sql.Scanner interface.

func (Constraints) String

func (c Constraints) String() string

func (*Constraints) UnmarshalJSON

func (c *Constraints) UnmarshalJSON(b []byte) error

type DeploymentsCreateOpts

type DeploymentsCreateOpts struct {
	// App is the app that is being deployed to.
	App *App

	// Image is the image that's being deployed.
	Image image.Image

	// User the user that is triggering the deployment.
	User *User

	// Output is an io.Writer where deployment output and events will be
	// streamed in jsonmessage format.
	Output io.Writer
}

DeploymentsCreateOpts represents options that can be passed when creating a new Deployment.

type DockerOptions

type DockerOptions struct {
	// The unix socket to connect to the docker api.
	Socket string

	// Path to a certificate to use for TLS connections.
	CertPath string

	// A set of docker registry credentials.
	Auth *docker.AuthConfigurations
}

DockerOptions is a set of options to configure a docker api client.

type Domain

type Domain struct {
	ID        string
	Hostname  string
	CreatedAt *time.Time

	AppID string
	App   *App
}

func (*Domain) BeforeCreate

func (d *Domain) BeforeCreate() error

type DomainsQuery

type DomainsQuery struct {
	// If provided, finds domains matching the given hostname.
	Hostname *string

	// If provided, filters domains belonging to the given app.
	App *App
}

DomainsQuery is a Scope implementation for common things to filter releases by.

func (DomainsQuery) Scope

func (q DomainsQuery) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type ECSOptions

type ECSOptions struct {
	Cluster     string
	ServiceRole string
}

ECSOptions is a set of options to configure ECS.

type ELBOptions

type ELBOptions struct {
	// The Security Group ID to assign when creating internal load balancers.
	InternalSecurityGroupID string

	// The Security Group ID to assign when creating external load balancers.
	ExternalSecurityGroupID string

	// The Subnet IDs to assign when creating internal load balancers.
	InternalSubnetIDs []string

	// The Subnet IDs to assign when creating external load balancers.
	ExternalSubnetIDs []string

	// Zone ID of the internal zone to add cnames for each elb
	InternalZoneID string
}

ELBOptions is a set of options to configure ELB.

type Empire

type Empire struct {
	// Reporter is an reporter.Reporter that will be used to report errors to
	// an external system.
	reporter.Reporter

	// Logger is a log15 logger that will be used for logging.
	Logger log15.Logger
	// contains filtered or unexported fields
}

Empire is a context object that contains a collection of services.

func New

func New(options Options) (*Empire, error)

New returns a new Empire instance.

func (*Empire) AccessTokensCreate

func (e *Empire) AccessTokensCreate(accessToken *AccessToken) (*AccessToken, error)

AccessTokensCreate creates a new AccessToken.

func (*Empire) AccessTokensFind

func (e *Empire) AccessTokensFind(token string) (*AccessToken, error)

AccessTokensFind finds an access token.

func (*Empire) Apps

func (e *Empire) Apps(q AppsQuery) ([]*App, error)

Apps returns all Apps.

func (*Empire) AppsCreate

func (e *Empire) AppsCreate(app *App) (*App, error)

AppsCreate creates a new app.

func (*Empire) AppsDestroy

func (e *Empire) AppsDestroy(ctx context.Context, app *App) error

AppsDestroy destroys the app.

func (*Empire) AppsFirst

func (e *Empire) AppsFirst(q AppsQuery) (*App, error)

AppsFirst finds the first app matching the query.

func (*Empire) AppsScale

func (e *Empire) AppsScale(ctx context.Context, app *App, t ProcessType, quantity int, c *Constraints) (*Process, error)

AppsScale scales an apps process.

func (*Empire) CertificatesCreate

func (e *Empire) CertificatesCreate(ctx context.Context, cert *Certificate) (*Certificate, error)

CertificatesCreate creates a certificate.

func (*Empire) CertificatesDestroy

func (e *Empire) CertificatesDestroy(ctx context.Context, cert *Certificate) error

CertificatesDestroy destroys a certificate.

func (*Empire) CertificatesFirst

func (e *Empire) CertificatesFirst(ctx context.Context, q CertificatesQuery) (*Certificate, error)

CertificatesFirst returns a certificate for the given ID

func (*Empire) CertificatesUpdate

func (e *Empire) CertificatesUpdate(ctx context.Context, cert *Certificate) (*Certificate, error)

CertificatesUpdate updates a certificate.

func (*Empire) ConfigsApply

func (e *Empire) ConfigsApply(ctx context.Context, app *App, vars Vars) (*Config, error)

ConfigsApply applies the new config vars to the apps current Config, returning a new Config. If the app has a running release, a new release will be created and run.

func (*Empire) ConfigsCurrent

func (e *Empire) ConfigsCurrent(app *App) (*Config, error)

ConfigsCurrent returns the current Config for a given app.

func (*Empire) Deploy

func (e *Empire) Deploy(ctx context.Context, opts DeploymentsCreateOpts) (*Release, error)

Deploy deploys an image and streams the output to w.

func (*Empire) Domains

func (e *Empire) Domains(q DomainsQuery) ([]*Domain, error)

Domains returns all domains matching the query.

func (*Empire) DomainsCreate

func (e *Empire) DomainsCreate(domain *Domain) (*Domain, error)

DomainsCreate adds a new Domain for an App.

func (*Empire) DomainsDestroy

func (e *Empire) DomainsDestroy(domain *Domain) error

DomainsDestroy removes a Domain for an App.

func (*Empire) DomainsFirst

func (e *Empire) DomainsFirst(q DomainsQuery) (*Domain, error)

DomainsFirst returns the first domain matching the query.

func (*Empire) IsHealthy

func (e *Empire) IsHealthy() bool

IsHealthy returns true if Empire is healthy, which means it can connect to the services it depends on.

func (*Empire) JobStatesByApp

func (e *Empire) JobStatesByApp(ctx context.Context, app *App) ([]*ProcessState, error)

JobStatesByApp returns the JobStates for the given app.

func (*Empire) ProcessesRestart

func (e *Empire) ProcessesRestart(ctx context.Context, app *App, id string) error

ProcessesRestart restarts processes matching the given prefix for the given Release. If the prefix is empty, it will match all processes for the release.

func (*Empire) ProcessesRun

func (e *Empire) ProcessesRun(ctx context.Context, app *App, opts ProcessRunOpts) error

ProcessesRun runs a one-off process for a given App and command.

func (*Empire) Releases

func (e *Empire) Releases(q ReleasesQuery) ([]*Release, error)

Releases returns all Releases for a given App.

func (*Empire) ReleasesFirst

func (e *Empire) ReleasesFirst(q ReleasesQuery) (*Release, error)

ReleasesFirst returns the first releases for a given App.

func (*Empire) ReleasesLast

func (e *Empire) ReleasesLast(app *App) (*Release, error)

ReleasesLast returns the last release for an App.

func (*Empire) ReleasesRollback

func (e *Empire) ReleasesRollback(ctx context.Context, app *App, version int) (*Release, error)

ReleasesRollback rolls an app back to a specific release version. Returns a new release.

func (*Empire) Reset

func (e *Empire) Reset() error

Reset resets empire.

func (*Empire) StreamLogs added in v0.9.2

func (e *Empire) StreamLogs(app *App, w io.Writer) error

Streamlogs streams logs from an app.

type Extractor

type Extractor interface {
	// Extract takes a repo in the form `remind101/r101-api`, and an image
	// id, and extracts the process types from the image.
	Extract(image.Image) (CommandMap, error)
}

Extractor represents an object that can extract the process types from an image.

type Formation

type Formation map[ProcessType]*Process

Formation maps a process ProcessType to a Process.

func NewFormation

func NewFormation(f Formation, cm CommandMap) Formation

NewFormation creates a new Formation based on an existing Formation and the available processes from a CommandMap.

func (Formation) Processes

func (f Formation) Processes() []*Process

Processes takes a Formation and returns a slice of the processes.

type LogsStreamer added in v0.9.2

type LogsStreamer interface {
	StreamLogs(*App, io.Writer) error
}

type Options

type Options struct {
	Docker DockerOptions
	ECS    ECSOptions
	ELB    ELBOptions

	// AWS Configuration
	AWSConfig *aws.Config

	Secret string

	// Database connection string.
	DB string

	// Location of the app logs
	LogsStreamer string
}

Options is provided to New to configure the Empire services.

type Port

type Port struct {
	ID    string
	AppID *string
	Port  int
}

type Process

type Process struct {
	ID       string
	Type     ProcessType
	Quantity int
	Command  Command
	Port     int `sql:"-"`
	Constraints

	ReleaseID string
	Release   *Release
}

Process holds configuration information about a Process Type.

func NewProcess

func NewProcess(t ProcessType, cmd Command) *Process

NewProcess returns a new Process instance.

type ProcessQuantityMap

type ProcessQuantityMap map[ProcessType]int

ProcessQuantityMap represents a map of process types to quantities.

type ProcessRunOpts

type ProcessRunOpts struct {
	Command string

	// If provided, input will be read from this.
	Input io.Reader

	// If provided, output will be written to this.
	Output io.Writer

	// Extra environment variables to set.
	Env map[string]string
}

type ProcessState

type ProcessState struct {
	Name        string
	Type        string
	Command     string
	State       string
	UpdatedAt   time.Time
	Constraints Constraints
}

ProcessState represents the state of a Process.

type ProcessType

type ProcessType string

ProcessType represents the type of a given process/command.

func (*ProcessType) Scan

func (p *ProcessType) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (ProcessType) Value

func (p ProcessType) Value() (driver.Value, error)

Value implements the driver.Value interface.

type ProcessesQuery

type ProcessesQuery struct {
	// If provided, finds only processes belonging to the given release.
	Release *Release
}

ProcessesQuery is a Scope implementation for common things to filter processes by.

func (ProcessesQuery) Scope

func (q ProcessesQuery) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type ProcfileError

type ProcfileError struct {
	Err error
}

Example instance: Procfile doesn't exist

func (*ProcfileError) Error

func (e *ProcfileError) Error() string

type Release

type Release struct {
	ID      string
	Version int

	AppID string
	App   *App

	ConfigID string
	Config   *Config

	SlugID string
	Slug   *Slug

	Processes []*Process

	Description string
	CreatedAt   *time.Time
}

Release is a combination of a Config and a Slug, which form a deployable release.

func (*Release) BeforeCreate

func (r *Release) BeforeCreate() error

BeforeCreate sets created_at before inserting.

func (*Release) Formation

func (r *Release) Formation() Formation

Formation creates a Formation object

type ReleasesQuery

type ReleasesQuery struct {
	// If provided, an app to filter by.
	App *App

	// If provided, a version to filter by.
	Version *int

	// If provided, uses the limit and sorting parameters specified in the range.
	Range headerutil.Range
}

ReleasesQuery is a Scope implementation for common things to filter releases by.

func (ReleasesQuery) DefaultRange

func (q ReleasesQuery) DefaultRange() headerutil.Range

DefaultRange returns the default headerutil.Range used if values aren't provided.

func (ReleasesQuery) Scope

func (q ReleasesQuery) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type Resolver

type Resolver interface {
	Resolve(context.Context, image.Image, io.Writer) (image.Image, error)
}

type Scope

type Scope interface {
	Scope(*gorm.DB) *gorm.DB
}

Scope is an interface that scopes a gorm.DB. Scopes are used in ThingsFirst and ThingsAll methods on the store for filtering/querying.

func FieldEquals

func FieldEquals(field string, v interface{}) Scope

FieldEquals returns a Scope that filters on a field.

func ForApp

func ForApp(app *App) Scope

ForApp returns a Scope that will filter items belonging the the given app.

func ID

func ID(id string) Scope

ID returns a Scope that will find the item by id.

func Limit

func Limit(limit int) Scope

Limit returns a Scope that limits the results.

func Order

func Order(order string) Scope

Order returns a Scope that orders the results.

func Preload

func Preload(associations ...string) Scope

Preload returns a Scope that preloads the associations.

func Range

func Range(r headerutil.Range) Scope

Range returns a Scope that limits and orders the results.

type ScopeFunc

type ScopeFunc func(*gorm.DB) *gorm.DB

ScopeFunc implements the Scope interface for functions.

func (ScopeFunc) Scope

func (f ScopeFunc) Scope(db *gorm.DB) *gorm.DB

Scope implements the Scope interface.

type Slug

type Slug struct {
	ID           string
	Image        image.Image
	ProcessTypes CommandMap
}

Slug represents a container image with the extracted ProcessType.

type User

type User struct {
	Name        string `json:"name"`
	GitHubToken string `json:"-"`
}

User represents a user of Empire.

func UserFromContext

func UserFromContext(ctx context.Context) (*User, bool)

UserFromContext returns a user from a context.Context if one is present.

func (*User) GitHubClient

func (u *User) GitHubClient() *http.Client

GitHubClient returns an http.Client that will automatically add the GitHubToken to all requests.

type ValidationError

type ValidationError struct {
	Err error
}

ValidationError is returned when a model is not valid.

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Variable

type Variable string

Variable represents the name of an environment variable.

type Vars

type Vars map[Variable]*string

Vars represents a variable -> value mapping.

func (*Vars) Scan

func (v *Vars) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (Vars) Value

func (v Vars) Value() (driver.Value, error)

Value implements the driver.Value interface.

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/go-uuid/uuid
The uuid package generates and inspects UUIDs.
The uuid package generates and inspects UUIDs.
_workspace/src/code.google.com/p/goauth2/oauth
Package oauth supports making OAuth2-authenticated HTTP requests.
Package oauth supports making OAuth2-authenticated HTTP requests.
_workspace/src/code.google.com/p/goauth2/oauth/example
This program makes a call to the specified API, authenticated with OAuth2.
This program makes a call to the specified API, authenticated with OAuth2.
_workspace/src/code.google.com/p/goauth2/oauth/jwt
The jwt package provides support for creating credentials for OAuth2 service account requests.
The jwt package provides support for creating credentials for OAuth2 service account requests.
_workspace/src/code.google.com/p/goauth2/oauth/jwt/example
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
_workspace/src/github.com/aws/aws-sdk-go/aws
Package aws provides core functionality for making requests to AWS services.
Package aws provides core functionality for making requests to AWS services.
_workspace/src/github.com/aws/aws-sdk-go/aws/awserr
Package awserr represents API error interface accessors for the SDK.
Package awserr represents API error interface accessors for the SDK.
_workspace/src/github.com/aws/aws-sdk-go/aws/credentials
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds
Package stscreds are credential Providers to retrieve STS AWS credentials.
Package stscreds are credential Providers to retrieve STS AWS credentials.
_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints
Package endpoints validates regional endpoints for services.
Package endpoints validates regional endpoints for services.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/json/jsonutil
Package jsonutil provides JSON serialisation of AWS requests and responses.
Package jsonutil provides JSON serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/jsonrpc
Package jsonrpc provides JSON RPC utilities for serialisation of AWS requests and responses.
Package jsonrpc provides JSON RPC utilities for serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query
Package query provides serialisation of AWS query requests, and responses.
Package query provides serialisation of AWS query requests, and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest
Package rest provides RESTful serialization of AWS requests and responses.
Package rest provides RESTful serialization of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/restxml
Package restxml provides RESTful XML serialisation of AWS requests and responses.
Package restxml provides RESTful XML serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil
Package xmlutil provides XML serialisation of AWS requests and responses.
Package xmlutil provides XML serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4
Package v4 implements signing for AWS V4 signer
Package v4 implements signing for AWS V4 signer
_workspace/src/github.com/aws/aws-sdk-go/service/ecs
Package ecs provides a client for Amazon EC2 Container Service.
Package ecs provides a client for Amazon EC2 Container Service.
_workspace/src/github.com/aws/aws-sdk-go/service/ecs/ecsiface
Package ecsiface provides an interface for the Amazon EC2 Container Service.
Package ecsiface provides an interface for the Amazon EC2 Container Service.
_workspace/src/github.com/aws/aws-sdk-go/service/elb
Package elb provides a client for Elastic Load Balancing.
Package elb provides a client for Elastic Load Balancing.
_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface
Package elbiface provides an interface for the Elastic Load Balancing.
Package elbiface provides an interface for the Elastic Load Balancing.
_workspace/src/github.com/aws/aws-sdk-go/service/iam
Package iam provides a client for AWS Identity and Access Management.
Package iam provides a client for AWS Identity and Access Management.
_workspace/src/github.com/aws/aws-sdk-go/service/iam/iamiface
Package iamiface provides an interface for the AWS Identity and Access Management.
Package iamiface provides an interface for the AWS Identity and Access Management.
_workspace/src/github.com/aws/aws-sdk-go/service/kinesis
Package kinesis provides a client for Amazon Kinesis.
Package kinesis provides a client for Amazon Kinesis.
_workspace/src/github.com/aws/aws-sdk-go/service/kinesis/kinesisiface
Package kinesisiface provides an interface for the Amazon Kinesis.
Package kinesisiface provides an interface for the Amazon Kinesis.
_workspace/src/github.com/aws/aws-sdk-go/service/route53
Package route53 provides a client for Amazon Route 53.
Package route53 provides a client for Amazon Route 53.
_workspace/src/github.com/aws/aws-sdk-go/service/route53/route53iface
Package route53iface provides an interface for the Amazon Route 53.
Package route53iface provides an interface for the Amazon Route 53.
_workspace/src/github.com/bgentry/heroku-go
Package heroku is a client interface to the Heroku API.
Package heroku is a client interface to the Heroku API.
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/dgrijalva/jwt-go
Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html See README.md for more info.
Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html See README.md for more info.
A useful example app.
_workspace/src/github.com/ejholmes/hookshot
Package hookshot is a router that de-multiplexes and authorizes github webhooks.
Package hookshot is a router that de-multiplexes and authorizes github webhooks.
_workspace/src/github.com/ejholmes/hookshot/events
Package events containers types representing GitHub webhook payloads.
Package events containers types representing GitHub webhook payloads.
_workspace/src/github.com/ejholmes/hookshot/hooker
Package hooker can generate github webhooks.
Package hooker can generate github webhooks.
_workspace/src/github.com/fsouza/go-dockerclient
Package docker provides a client for the Docker remote API.
Package docker provides a client for the Docker remote API.
_workspace/src/github.com/fsouza/go-dockerclient/testing
Package testing provides a fake implementation of the Docker API, useful for testing purpose.
Package testing provides a fake implementation of the Docker API, useful for testing purpose.
_workspace/src/github.com/go-sql-driver/mysql
Go MySQL Driver - A MySQL-Driver for Go's database/sql package The driver should be used via the database/sql package: import "database/sql" import _ "github.com/go-sql-driver/mysql" db, err := sql.Open("mysql", "user:password@/dbname") See https://github.com/go-sql-driver/mysql#usage for details
Go MySQL Driver - A MySQL-Driver for Go's database/sql package The driver should be used via the database/sql package: import "database/sql" import _ "github.com/go-sql-driver/mysql" db, err := sql.Open("mysql", "user:password@/dbname") See https://github.com/go-sql-driver/mysql#usage for details
_workspace/src/github.com/gocql/gocql
Package gocql implements a fast and robust Cassandra driver for the Go programming language.
Package gocql implements a fast and robust Cassandra driver for the Go programming language.
_workspace/src/github.com/golang/groupcache/lru
Package lru implements an LRU cache.
Package lru implements an LRU cache.
_workspace/src/github.com/golang/snappy/snappy
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.
_workspace/src/github.com/google/go-github/github
Package github provides a client for using the GitHub API.
Package github provides a client for using the GitHub API.
_workspace/src/github.com/google/go-querystring/query
Package query implements encoding of structs into URL query parameters.
Package query implements encoding of structs into URL query parameters.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/inconshreveable/log15
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
_workspace/src/github.com/inconshreveable/log15/stack
Package stack implements utilities to capture, manipulate, and format call stacks.
Package stack implements utilities to capture, manipulate, and format call stacks.
_workspace/src/github.com/lib/pq
Package pq is a pure Go Postgres driver for the database/sql package.
Package pq is a pure Go Postgres driver for the database/sql package.
_workspace/src/github.com/lib/pq/listen_example
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
_workspace/src/github.com/lib/pq/oid
Package oid contains OID constants as defined by the Postgres server.
Package oid contains OID constants as defined by the Postgres server.
_workspace/src/github.com/mattes/migrate/driver
Package driver holds the driver interface.
Package driver holds the driver interface.
_workspace/src/github.com/mattes/migrate/driver/bash
Package bash implements the Driver interface.
Package bash implements the Driver interface.
_workspace/src/github.com/mattes/migrate/driver/cassandra
Package cassandra implements the Driver interface.
Package cassandra implements the Driver interface.
_workspace/src/github.com/mattes/migrate/driver/mysql
Package mysql implements the Driver interface.
Package mysql implements the Driver interface.
_workspace/src/github.com/mattes/migrate/driver/postgres
Package postgres implements the Driver interface.
Package postgres implements the Driver interface.
_workspace/src/github.com/mattes/migrate/file
Package file contains functions for low-level migration files handling.
Package file contains functions for low-level migration files handling.
_workspace/src/github.com/mattes/migrate/migrate
Package migrate is imported by other Go code.
Package migrate is imported by other Go code.
_workspace/src/github.com/mattes/migrate/migrate/direction
Package direction just holds convenience constants for Up and Down migrations.
Package direction just holds convenience constants for Up and Down migrations.
_workspace/src/github.com/mattes/migrate/pipe
Package pipe has functions for pipe channel handling.
Package pipe has functions for pipe channel handling.
_workspace/src/github.com/remind101/newrelic
No op implementation for non linux platforms (new relix agent sdk only support linux right now)
No op implementation for non linux platforms (new relix agent sdk only support linux right now)
_workspace/src/github.com/remind101/pkg/httpx
package httpx provides an extra layer of convenience over package http.
package httpx provides an extra layer of convenience over package http.
_workspace/src/github.com/remind101/pkg/logger
package logger is a package that provides a structured logger that's context.Context aware.
package logger is a package that provides a structured logger that's context.Context aware.
_workspace/src/github.com/remind101/pkg/reporter
package reporter provides a context.Context aware abstraction for shuttling errors and panics to third partys.
package reporter provides a context.Context aware abstraction for shuttling errors and panics to third partys.
_workspace/src/github.com/remind101/pkg/reporter/hb
package hb is a Go package from sending errors to Honeybadger.
package hb is a Go package from sending errors to Honeybadger.
_workspace/src/github.com/remind101/tugboat/pkg/heroku
Generated service client for heroku API.
Generated service client for heroku API.
_workspace/src/github.com/remind101/tugboat/pkg/hooker
package hooker can generate github webhooks.
package hooker can generate github webhooks.
_workspace/src/github.com/remind101/tugboat/pkg/pusherauth
package pusherauth is a package for generating pusher authentication signatures.
package pusherauth is a package for generating pusher authentication signatures.
_workspace/src/github.com/vaughan0/go-ini
Package ini provides functions for parsing INI configuration files.
Package ini provides functions for parsing INI configuration files.
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/gopkg.in/gorp.v1
Package gorp provides a simple way to marshal Go structs to and from SQL databases.
Package gorp provides a simple way to marshal Go structs to and from SQL databases.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
_workspace/src/speter.net/go/exp/math/dec/inf
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.
cmd
pkg
arn
package arn is a Go package for parsing Amazon Resource Names.
package arn is a Go package for parsing Amazon Resource Names.
bytesize
package bytesize contains constants for easily switching between different byte sizes.
package bytesize contains constants for easily switching between different byte sizes.
constraints
package constraints contains methods for decoding a compact CPU and Memory constraints format.
package constraints contains methods for decoding a compact CPU and Memory constraints format.
ecsutil
Package ecsutil is a layer on top of Amazon ECS to provide an app aware ECS client.
Package ecsutil is a layer on top of Amazon ECS to provide an app aware ECS client.
image
Package image contains methods and helpers for parsing the docker image format.
Package image contains methods and helpers for parsing the docker image format.
lb
package lb provides an abstraction around creating load balancers.
package lb provides an abstraction around creating load balancers.
runner
package runner provides a simple interface for running docker containers.
package runner provides a simple interface for running docker containers.
stream
Package stream provides types that make it easier to perform streaming.
Package stream provides types that make it easier to perform streaming.
stream/http
Package http provides streaming implementations of various net/http types.
Package http provides streaming implementations of various net/http types.
Package scheduler provides the core interface that Empire uses when interacting with a cluster of machines to run tasks.
Package scheduler provides the core interface that Empire uses when interacting with a cluster of machines to run tasks.
cloudformation
Package cloudformation implements the Scheduler interface for ECS by using CloudFormation to provision and update resources.
Package cloudformation implements the Scheduler interface for ECS by using CloudFormation to provision and update resources.
docker
Package docker implements the Scheduler interface backed by the Docker API.
Package docker implements the Scheduler interface backed by the Docker API.
ecs
Pacakge ecs provides an implementation of the Scheduler interface that uses Amazon EC2 Container Service.
Pacakge ecs provides an implementation of the Scheduler interface that uses Amazon EC2 Container Service.
kubernetes
Package kubernetes implements the Scheduler interface backed by Kubernetes.
Package kubernetes implements the Scheduler interface backed by Kubernetes.

Jump to

Keyboard shortcuts

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