shipyard

package module
v0.0.0-...-df63bc0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2013 License: Apache-2.0 Imports: 14 Imported by: 0

README

shipyard

A service provisioning engine built on docker.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRouteRequest

type AddRouteRequest struct {
	Gateway        string
	NetworkAddress Network
}

Argument to Shoreman.AddRoute()

type GetHostsReply

type GetHostsReply struct {
	Hosts map[string]*Host
}

type Host

type Host struct {
	Name           string
	Id             string
	Cores          int
	Memory         int64
	PrivateNetwork Network
	LastUpdated    time.Time
	// contains filtered or unexported fields
}

func CurrentContextAsHost

func CurrentContextAsHost() (host *Host, err error)

Create a new Host struct from the running host's values

func (*Host) String

func (h *Host) String() string

type Image

type Image struct {
	Name string
	Id   string
	Tags map[string]string
	// contains filtered or unexported fields
}

type Network

type Network struct {
	Address string
	Netmask string
}

func NewNetwork

func NewNetwork(address, netmask string) (network *Network, err error)

type PortType

type PortType struct {
	Port        uint16
	Transport   TransportType
	Application string
	// contains filtered or unexported fields
}

type ResourcePool

type ResourcePool struct {
	Name      string
	Id        string
	Cores     int
	Memory    int64
	HostsRefs []string
	// contains filtered or unexported fields
}

Represents a set of available resources and their contraints.

func (*ResourcePool) GetTotalCores

func (pool *ResourcePool) GetTotalCores() (cores int, err error)

Get the total amount of cores in the resource pool

func (*ResourcePool) GetTotalMemory

func (pool *ResourcePool) GetTotalMemory() (totalMemory int64, err error)

Get the total amount of memory in this resource pool.

func (*ResourcePool) Save

func (pool *ResourcePool) Save() string

Prettyprint ResourcePool

type Service

type Service struct {
	Name         string
	Id           string
	ImageRef     string
	Description  string
	Startup      string
	Shutdown     string
	Priority     int8
	Endpoints    map[uint16]*PortType
	ServicePorts []*ServicePort
	// contains filtered or unexported fields
}

type ServiceController

type ServiceController struct {
	Hosts         map[string]*Host
	ResourcePools map[string]*ResourcePool
	SystemId      string
	Services      map[string]*Service
	// contains filtered or unexported fields
}

func NewServiceController

func NewServiceController(filename string) (c *ServiceController, err error)

Create a new ServiceController.

func (*ServiceController) AddHost

func (c *ServiceController) AddHost(host *Host) error

func (*ServiceController) Save

func (c *ServiceController) Save() error

Save the ServiceController to disk.

type ServicePort

type ServicePort struct {
	ServiceId string   // unique ID for a Service
	Port      PortType // the Port to map to the Service
	// contains filtered or unexported fields
}

type ShipyardClient

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

The Shoreman API client

func NewShipyardClient

func NewShipyardClient(connectionString string) (client *ShipyardClient, err error)

Create a ShipyardService client.

func (*ShipyardClient) GetHosts

func (client *ShipyardClient) GetHosts() (hosts map[string]*Host, err error)

Call GetHosts() on the ShipyardService

type ShipyardError

type ShipyardError struct {
	ErrorMessage string
}

func (ShipyardError) Error

func (e ShipyardError) Error() string

type ShipyardService

type ShipyardService struct {
	Hosts    map[string]*Host
	Services map[string]*Service
	// contains filtered or unexported fields
}

API for Shipyard service

func NewShipyardService

func NewShipyardService(datafile string) (server *ShipyardService, err error)

Create a new Shipyard instance.

func (*ShipyardService) GetHosts

func (s *ShipyardService) GetHosts(unused *interface{}, reply *GetHostsReply) error

Return Host obect to client

type Shoreman

type Shoreman struct{}

API for Shoreman daemon.

func (*Shoreman) AddRoute

func (s *Shoreman) AddRoute(request AddRouteRequest, unused *interface{}) error

Attempt to add a static route to the Shoreman host

func (*Shoreman) DockerNetwork

func (s *Shoreman) DockerNetwork(unused *interface{}, network *Network) error

Return the private network used by docker running on this host.

func (*Shoreman) HostInfo

func (s *Shoreman) HostInfo(unused *interface{}, host *Host) error

Return Host obect to client

type ShoremanClient

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

The Shoreman API client

func NewShoremanClient

func NewShoremanClient(connectionString string) (client *ShoremanClient, err error)

Create a new Shoreman RPC client

func (*ShoremanClient) AddRoute

func (client *ShoremanClient) AddRoute(gateway string, network Network) error

Attempt to add a static route to the Shoreman host

func (*ShoremanClient) Close

func (client *ShoremanClient) Close() error

func (*ShoremanClient) DockerNetwork

func (client *ShoremanClient) DockerNetwork() (network *Network, err error)

call the Shoreman.DockerNetwork() RPC

func (*ShoremanClient) HostInfo

func (client *ShoremanClient) HostInfo() (host *Host, err error)

call Shoreman.HostInfo() RPC method

type ShoremanError

type ShoremanError struct {
	ErrorMessage string
}

An error type for Shoreman operations

func (ShoremanError) Error

func (e ShoremanError) Error() string

type TransportType

type TransportType string
const (
	TCP TransportType = "tcp"
	UDP TransportType = "udp"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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