containers

package
v0.0.0-...-7ed9018 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainersFile      = "containers"
	PortsFile           = "ports"
	NetworkSecurityFile = "netsec"
)

Variables

View Source
var (
	NetworkSecurity   *netsec.NetworkSecurity
	EnableNetsec      bool
	NumContainers     uint16 // for maximum efficiency, should = CPUShares
	NumSecondaryPorts uint16
	MinPort           uint16
	CPUShares         uint // relative
	MemoryLimit       uint // actual MB

)

Functions

func AuthorizeSSHUser

func AuthorizeSSHUser(c types.GenericContainer, user, publicKey string) error

func DeauthorizeSSHUser

func DeauthorizeSSHUser(c types.GenericContainer, user string) error

func Get

func Get(id string) *types.Container

func Init

func Init(registry, saveDir string, numContainers, numSecondaryPorts, minPort uint16, cpu, memory uint, enableNetsec bool) error

Initialize everything needed to use containers

func List

func List() (map[string]*types.Container, []uint16)

List all containers and free ports

func Nums

func Nums() (containers *types.ResourceStats, cpu *types.ResourceStats, memory *types.ResourceStats)

Return the number of total, used, and free containers

func SetMaintenance

func SetMaintenance(c types.GenericContainer, maint bool) error

func Teardown

func Teardown(id string) bool

Teardown a container

Types

type Container

type Container struct {
	types.Container
}

func Reserve

func Reserve(id string, manifest *types.Manifest) (*Container, error)

Reserve a container

func (*Container) Deploy

func (c *Container) Deploy(host, app, sha, env string) error

Deploy the given app+sha with the dependencies defined in deps. This will spin up a new docker container.

func (*Container) Teardown

func (c *Container) Teardown()

This calls the Teardown(id string) method to ensure that the ports/containers are freed. That will in turn call c.teardown(id string)

type GetReq

type GetReq struct {
	// contains filtered or unexported fields
}

type ListResp

type ListResp struct {
	// contains filtered or unexported fields
}

type NumsResp

type NumsResp struct {
	Containers *types.ResourceStats
	CPUShares  *types.ResourceStats
	Memory     *types.ResourceStats
}

type ReserveReq

type ReserveReq struct {
	// contains filtered or unexported fields
}

type ReserveResp

type ReserveResp struct {
	// contains filtered or unexported fields
}

type SSHCmd

type SSHCmd []string

func (SSHCmd) Execute

func (s SSHCmd) Execute() error

type TeardownReq

type TeardownReq struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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