Documentation ¶
Index ¶
- Constants
- Variables
- func CurrentStackImagePath(stacksDir, name string) (string, error)
- func StartControlAPI(socket string, processes <-chan *Processes) <-chan *Processes
- type APIFormation
- type APIPoller
- type AbsPathDynoDriver
- type Action
- type Allocator
- type AppSerializable
- type ControlAPI
- type DirPoller
- type Docker
- type DockerDynoDriver
- type DockerStackImage
- type DynoDriver
- type DynoInput
- type DynoState
- type Executor
- type ExitStatus
- type Formation
- type FormationSerializable
- type GobNotifier
- type HerokuStackImage
- type IPInfo
- type LibContainerDynoDriver
- type LibContainerInitDriver
- type Notifier
- type ProcessStatus
- type Processes
- type Release
- type Routed
- type SimpleDynoDriver
- type SlugWhere
- type Startup
- type StatusResponse
- type StopRequest
- type StopResponse
Constants ¶
const DefaultPort = "5000"
const (
// currently available versions of Heroku stack images
HerokuStacksManifestURL = "https://s3.amazonaws.com/heroku_stacks_production/manifest.yml"
)
Variables ¶
var ( // 172.16/12 block, starting at 172.16.0.28/30 // By default allocate IPs from the RFC1918 (private address space), // which provides at most 2**18 = 262144 subnets of size /30. // Skip the first few IPs from RFC1918 to avoid clashes with // IPs used by AWS (eg.: the internal DNS server is 172.16.0.23 on EC2 // classic). DefaultPrivateSubnet = net.IPNet{ IP: net.IPv4(172, 16, 0, 28).To4(), Mask: net.CIDRMask(12, 32), } )
var ErrExecutorComplete = errors.New("Executor complete")
var ErrIPNotFound = errors.New("ip not found")
var (
ErrInvalidIPMask = errors.New("mask is not a /30")
)
var ErrNoReleases = errors.New("No releases found")
var ErrNoSlugURL = errors.New("no slug specified")
Functions ¶
func CurrentStackImagePath ¶
func StartControlAPI ¶
Types ¶
type APIFormation ¶
type APIFormation struct {
// contains filtered or unexported fields
}
func (*APIFormation) Args ¶
func (f *APIFormation) Args() []string
func (*APIFormation) Quantity ¶
func (f *APIFormation) Quantity() int
func (*APIFormation) Type ¶
func (f *APIFormation) Type() string
type APIPoller ¶
type APIPoller struct { Cl *heroku.Service Hs *Startup // contains filtered or unexported fields }
type AbsPathDynoDriver ¶
type AbsPathDynoDriver struct { }
func (*AbsPathDynoDriver) Build ¶
func (dd *AbsPathDynoDriver) Build(release *Release) (err error)
func (*AbsPathDynoDriver) Start ¶
func (dd *AbsPathDynoDriver) Start(ex *Executor) (err error)
func (*AbsPathDynoDriver) Stop ¶
func (dd *AbsPathDynoDriver) Stop(ex *Executor) error
func (*AbsPathDynoDriver) Wait ¶
func (dd *AbsPathDynoDriver) Wait(ex *Executor) (s *ExitStatus)
type Allocator ¶ added in v0.0.7
type Allocator struct {
// contains filtered or unexported fields
}
Allocator is responsible for allocating globally unique (per host) resources.
func NewAllocator ¶ added in v0.0.7
func NewAllocator( workDir string, privateSubnet net.IPNet, minUID, maxUID int, ) (*Allocator, error)
NewAllocator receives a CIDR block to allocate dyno subnets from, in the form baseIP/mask. All subnets will be >= baseIP, e.g.: 172.16.0.28/12 will cause subnets of size /30 to be allocated from 172.16/12, starting at 172.16.0.28/30.
To avoid reusing the same subnet for two different dynos (UIDs), make sure (maxUID - minUID) <= /30 subnets that the CIDR block can provide. E.g.: 172.17/16 can provide 2 ** (30-16) = 16384 /30 subnets, then to avoid subnets being reused, make sure that (maxUID - minUID) <= 16384.
func (*Allocator) FreeUID ¶ added in v0.0.7
FreeUID returns the provided UID to the pool to be used by others
func (*Allocator) ReserveUID ¶ added in v0.0.7
ReserveUID optimistically locks uid numbers until one is successfully allocated. It relies on atomic filesystem operations to guarantee that multiple concurrent tasks will never allocate the same uid.
uid numbers allocated by this should be returned to the pool with FreeUID when they are not required anymore.
type AppSerializable ¶
type AppSerializable struct { Version int Name string Env map[string]string Slug string Stack string Processes []FormationSerializable // LogplexURL specifies where to forward the supervised // process Stdout and Stderr when non-empty. LogplexURL string `json:",omitempty"` }
func (*AppSerializable) MustParseLogplexURL ¶ added in v0.0.5
func (as *AppSerializable) MustParseLogplexURL() *url.URL
Convenience function for parsing the stringy LogplexURL. This is helpful because gob encoding of url.URL values is not supported. It's presumed that the URL-conformance of LogplexURL has already been verified.
type ControlAPI ¶
func (*ControlAPI) Tee ¶
func (c *ControlAPI) Tee(procs <-chan *Processes) <-chan *Processes
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
func (*Docker) BuildSlugImage ¶
func (d *Docker) BuildSlugImage(si *DockerStackImage, release *Release) ( string, error)
type DockerDynoDriver ¶
type DockerDynoDriver struct {
// contains filtered or unexported fields
}
func (*DockerDynoDriver) Build ¶
func (dd *DockerDynoDriver) Build(release *Release) error
func (*DockerDynoDriver) IPInfo ¶ added in v0.0.10
func (dd *DockerDynoDriver) IPInfo(ex *Executor) IPInfo
func (*DockerDynoDriver) Start ¶
func (dd *DockerDynoDriver) Start(ex *Executor) error
func (*DockerDynoDriver) Stop ¶
func (dd *DockerDynoDriver) Stop(ex *Executor) error
func (*DockerDynoDriver) Wait ¶
func (dd *DockerDynoDriver) Wait(ex *Executor) (s *ExitStatus)
type DockerStackImage ¶
type DockerStackImage struct {
// contains filtered or unexported fields
}
type DynoDriver ¶
type Executor ¶
type Executor struct { Args []string DynoDriver DynoDriver Release *Release ProcessID int ProcessType string Status chan *ExitStatus Complete chan struct{} LogplexURL *url.URL Binds map[string]string // FSM Fields OneShot bool State DynoState NewInput chan DynoInput // Status API fields IPInfo IPInfo // contains filtered or unexported fields }
type ExitStatus ¶
type FormationSerializable ¶
type FormationSerializable struct { FArgs []string `json:"Args"` FQuantity int `json:"Quantity"` FType string `json:"Type"` }
func (*FormationSerializable) Args ¶
func (fs *FormationSerializable) Args() []string
func (*FormationSerializable) Quantity ¶
func (fs *FormationSerializable) Quantity() int
func (*FormationSerializable) Type ¶
func (fs *FormationSerializable) Type() string
type GobNotifier ¶
type GobNotifier struct {
Payload string
}
func (*GobNotifier) Notify ¶
func (gn *GobNotifier) Notify() <-chan *Processes
type HerokuStackImage ¶
type HerokuStackImage struct { Name string Version string URL string `yaml:"url"` Md5 string Primary bool // contains filtered or unexported fields }
HerokuStackImage models stack images as they are distributed by Heroku: binary disk images, usually intended to be mounted on loopback devices. The common use is to mount those images read-only, so a single immutable image can be shared by multiple containers, saving disk space and memory due to Linux CoW page sharing.
Support for Heroku stack images is currently only enabled when building for Linux, because these images are currently only used by the libcontainer driver.
func HerokuStacksFromManifest ¶
func HerokuStacksFromManifest(stacksDir string) ([]HerokuStackImage, error)
func (*HerokuStackImage) Dir ¶
func (img *HerokuStackImage) Dir() string
func (*HerokuStackImage) Filename ¶
func (img *HerokuStackImage) Filename() string
type IPInfo ¶ added in v0.0.10
func DefaultIPInfo ¶ added in v0.0.10
type LibContainerDynoDriver ¶
type LibContainerDynoDriver struct {
// contains filtered or unexported fields
}
func NewLibContainerDynoDriver ¶
func NewLibContainerDynoDriver(workDir string) (*LibContainerDynoDriver, error)
func (*LibContainerDynoDriver) Build ¶
func (dd *LibContainerDynoDriver) Build(release *Release) error
func (*LibContainerDynoDriver) Start ¶
func (dd *LibContainerDynoDriver) Start(ex *Executor) error
func (*LibContainerDynoDriver) Stop ¶
func (dd *LibContainerDynoDriver) Stop(ex *Executor) error
func (*LibContainerDynoDriver) Wait ¶
func (dd *LibContainerDynoDriver) Wait(ex *Executor) (s *ExitStatus)
type LibContainerInitDriver ¶
type LibContainerInitDriver struct{}
LibContainerInitDriver is intended to be used as init (PID=1) inside containers created by the libcontainer driver. It exists solely to be called by the libcontainer driver and should not be used directly.
func (*LibContainerInitDriver) Build ¶
func (dd *LibContainerInitDriver) Build(*Release) error
func (*LibContainerInitDriver) Start ¶
func (dd *LibContainerInitDriver) Start(ex *Executor) error
Start acts as PID=1 inside a container spawned by libcontainer, doing the required setup and re-exec'ing as the abspath driver
func (*LibContainerInitDriver) Stop ¶
func (dd *LibContainerInitDriver) Stop(*Executor) error
func (*LibContainerInitDriver) Wait ¶
func (dd *LibContainerInitDriver) Wait(*Executor) *ExitStatus
type ProcessStatus ¶ added in v0.0.10
type Release ¶
type Release struct {
// contains filtered or unexported fields
}
func (*Release) ConfigSlice ¶
type Routed ¶ added in v0.0.7
Routed implements libcontainer's network.NetworkStrategy interface, offering containers only layer 3 connectivity to the outside world.
func (*Routed) Create ¶ added in v0.0.7
Create sets up a veth pair, setting the config.Gateway address on the master (host) side. The veth pair forms a small subnet with a single host and gateway.
func (*Routed) Initialize ¶ added in v0.0.7
type SimpleDynoDriver ¶
type SimpleDynoDriver struct { }
func (*SimpleDynoDriver) Build ¶
func (dd *SimpleDynoDriver) Build(release *Release) error
func (*SimpleDynoDriver) Start ¶
func (dd *SimpleDynoDriver) Start(ex *Executor) (err error)
func (*SimpleDynoDriver) Stop ¶
func (dd *SimpleDynoDriver) Stop(ex *Executor) error
func (*SimpleDynoDriver) Wait ¶
func (dd *SimpleDynoDriver) Wait(ex *Executor) (s *ExitStatus)
type Startup ¶ added in v0.0.2
type Startup struct { // App contains a representation of a single release of an // application to run. App AppSerializable // OneShot is true when hsup terminates after the supervised // program exits. OneShot bool // StartNumber is the first allocated ProcessID. e.g. "2" in // the case of "web.2". StartNumber int // Action enumerates the high level action of this hsup, // e.g. "run", "start", "build". Action Action // Driver specifies the DynoDriver used to execute a program // under hsup. If used for sub-invocations, it must be // registered via "gob.Register". Driver DynoDriver // SkipBuild is set to true tos kip skip the build step of // running a program. This is useful when hsup is being // executed in the context of an already-prepared image // containing a program. SkipBuild bool // Formation name for "Start" action. FormName string // ControlSocket specifies the unix socket the hsup API listens on. // Set to "" when API support is disabled. ControlSocket string // For use with "run". Args []string // Binds enumerates paths bound from the host into a // container. Binds map[string]string }
Startup is a serializable struct sufficient to perform sub-invocations of hsup.
func (*Startup) FromBase64Gob ¶ added in v0.0.2
func (*Startup) ToBase64Gob ¶ added in v0.0.2
type StatusResponse ¶
type StatusResponse struct {
Processes map[string]ProcessStatus
}
type StopRequest ¶
type StopRequest struct {
Processes []string
}
type StopResponse ¶
type StopResponse struct {
StoppedProcesses []string
}
Source Files ¶
- abspath_dyno_driver.go
- allocator.go
- api_poller.go
- control_api.go
- dir_poller.go
- docker.go
- docker_dyno_driver.go
- dyno_driver.go
- dynostate_string.go
- executor.go
- gob_notifier.go
- json_load.go
- libcontainer_dyno_driver.go
- libcontainer_init.go
- libcontainer_network.go
- logplex.go
- processes.go
- serialization.go
- simple_dyno_driver.go
- stack_image.go
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/bitbucket.org/kardianos/osext
Extensions to the standard "os" package.
|
Extensions to the standard "os" package. |
_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/github.com/bmizerany/aws4
Package aws4 signs HTTP requests as prescribed in http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
|
Package aws4 signs HTTP requests as prescribed in http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html |
_workspace/src/github.com/bmizerany/aws4/dydb
This is an experimental library for use with DynamoDB.
|
This is an experimental library for use with DynamoDB. |
_workspace/src/github.com/coreos/go-systemd/dbus
Integration with the systemd D-Bus API.
|
Integration with the systemd D-Bus API. |
_workspace/src/github.com/cyberdelia/heroku-go/v3
Generated service client for heroku API.
|
Generated service client for heroku API. |
_workspace/src/github.com/docker/docker/pkg/pools
Package pools provides a collection of pools which provide various data types with buffers.
|
Package pools provides a collection of pools which provide various data types with buffers. |
_workspace/src/github.com/docker/libcontainer
Temporary API endpoint for libcontainer while the full API is finalized (api.go).
|
Temporary API endpoint for libcontainer while the full API is finalized (api.go). |
_workspace/src/github.com/docker/libcontainer/integration
integration is used for integration testing of libcontainer
|
integration is used for integration testing of libcontainer |
_workspace/src/github.com/docker/libcontainer/netlink
Packet netlink provide access to low level Netlink sockets and messages.
|
Packet netlink provide access to low level Netlink sockets and messages. |
_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/godbus/dbus
Package dbus implements bindings to the D-Bus message bus system.
|
Package dbus implements bindings to the D-Bus message bus system. |
_workspace/src/github.com/godbus/dbus/introspect
Package introspect provides some utilities for dealing with the DBus introspection format.
|
Package introspect provides some utilities for dealing with the DBus introspection format. |
_workspace/src/github.com/godbus/dbus/prop
Package prop provides the Properties struct which can be used to implement org.freedesktop.DBus.Properties.
|
Package prop provides the Properties struct which can be used to implement org.freedesktop.DBus.Properties. |
_workspace/src/github.com/nu7hatch/gouuid
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
|
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122. |
_workspace/src/github.com/ogier/pflag
pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
|
pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. |
_workspace/src/github.com/rcrowley/go-metrics
Go port of Coda Hale's Metrics library <https://github.com/rcrowley/go-metrics> Coda Hale's original work: <https://github.com/codahale/metrics>
|
Go port of Coda Hale's Metrics library <https://github.com/rcrowley/go-metrics> Coda Hale's original work: <https://github.com/codahale/metrics> |
_workspace/src/github.com/rcrowley/go-metrics/stathat
Metrics output to StatHat.
|
Metrics output to StatHat. |
_workspace/src/github.com/syndtr/gocapability/capability
Package capability provides utilities for manipulating POSIX capabilities.
|
Package capability provides utilities for manipulating POSIX capabilities. |
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
|
Package yaml implements YAML support for the Go language. |
cmd
|
|
Package diag implements a fixed-size ring buffer to store diagnostic text in.
|
Package diag implements a fixed-size ring buffer to store diagnostic text in. |