Documentation ¶
Overview ¶
Package api provides the server and structures to respond to Panamax Remote Agent Requests.
Index ¶
Constants ¶
const ( API_VERSION = "v1" VERSION = "0.1.0" )
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(adapterInst PanamaxAdapter) *martiniServer
NewServer creates an instance of a martini server. The adapterInst parameter is the adapter type the server will use when dispatching requests.
Types ¶
type Deployment ¶
type Deployment struct {
Count int `json:"count,omitempty"`
}
Deployment structure contains the deployment count for a service.
type Environment ¶
A Environment is a structure which contains environmental variables. They are equivalent to the -e "Name=Value" on the docker command line.
type Error ¶
Error is an application specific error structure which encapsulates an error code and message.
type Link ¶
A Link is equivalent to the docker link command. It contains the named of a service and the desired alias.
type PanamaxAdapter ¶
type PanamaxAdapter interface { GetServices() ([]*Service, *Error) GetService(string) (*Service, *Error) CreateServices([]*Service) ([]*Service, *Error) UpdateService(*Service) *Error DestroyService(string) *Error }
PanamaxAdapter encapulates the CRUD operations for Services. These methods must be implemented to fulfill the adapter contract.
type Port ¶
type Port struct { HostPort uint16 `json:"hostPort,omitempty"` ContainerPort uint16 `json:"containerPort"` Protocol string `json:"protocol,omitempty"` }
A Port is desribes a docker port mapping.
type Service ¶
type Service struct { Id string `json:"id"` Name string `json:"name,omitempty"` Source string `json:"source,omitempty"` Command string `json:"command,omitempty"` Links []*Link `json:"links,omitempty"` Ports []*Port `json:"ports,omitempty"` Expose []uint16 `json:"expose,omitempty"` Environment []*Environment `json:"environment,omitempty"` Volumes []*Volume `json:"volumes,omitempty"` VolumesFrom []*VolumesFrom `json:"volumes_from,omitempty"` ActualState string `json:"actualState,omitempty"` Deployment Deployment `json:"deployment,omitempty"` }
A Service describes the information needed to deploy and scale a desired application. The Id is required and the actualState is used to provide status back to the remote agent.
type Volume ¶
type Volume struct { HostPath string `json:"hostPath"` ContainerPath string `json:"containerPath"` }
A Volume is used to mount a host directory into the container and is translated into a -v docker command.
type VolumesFrom ¶
type VolumesFrom struct {
Name string `json:"name"`
}