Documentation ¶
Index ¶
- type AgentMetadata
- type Deployment
- type DeploymentBlueprint
- type DeploymentResponseFull
- type DeploymentResponseLite
- type DeploymentSettings
- type DeploymentStore
- type Environment
- type FromIntOrString
- type Image
- type Link
- type Manager
- type Metadata
- type Port
- type Service
- type Status
- type Template
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentMetadata ¶
type AgentMetadata struct {
Version string `json:"version"`
}
AgentMetadata contains metadata specifically for the Agent.
type Deployment ¶
Deployment represents a stored deployment.
type DeploymentBlueprint ¶
type DeploymentBlueprint struct { Override Template `json:"override,omitempty"` Template Template `json:"template,omitempty"` }
A DeploymentBlueprint is the top level entity, containing all the necessary bits to kick off a deployment.
func (*DeploymentBlueprint) MergedImages ¶
func (d *DeploymentBlueprint) MergedImages() []Image
MergedImages merges the Override on top of the Template, returning the resulting merged Images to be used for deployment.
type DeploymentResponseFull ¶
type DeploymentResponseFull struct { ID int `json:"id"` Name string `json:"name"` Redeployable bool `json:"redeployable"` Status Status `json:"status"` }
DeploymentResponseFull is the robust representation of a Deployment typically used for the return value of an individual deployment, etc.
type DeploymentResponseLite ¶
type DeploymentResponseLite struct { ID int `json:"id"` Name string `json:"name"` Redeployable bool `json:"redeployable"` ServiceIDs []string `json:"service_ids"` }
DeploymentResponseLite is the minimal representation of a Deployment typically used for listings, etc.
type DeploymentSettings ¶
type DeploymentSettings struct {
Count FromIntOrString `json:"count,omitempty"`
}
DeploymentSettings contains orchestrator specific information to be used when deploying an application.
type DeploymentStore ¶
type DeploymentStore interface { FindByID(int) (Deployment, error) All() ([]Deployment, error) Save(*Deployment) error Remove(int) error }
DeploymentStore is an interface that can persist information for an agent about deployments.
type Environment ¶
type Environment struct { Variable string `json:"variable,omitempty"` Value string `json:"value,omitempty"` }
Environment represents each environment variable that will be passed to the Docker run command.
type FromIntOrString ¶
type FromIntOrString struct {
Value int
}
FromIntOrString allows source JSON to provide either an int or a string and have it be unmarshalled to an int.
func (FromIntOrString) MarshalJSON ¶
func (i FromIntOrString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface.
func (*FromIntOrString) UnmarshalJSON ¶
func (i *FromIntOrString) UnmarshalJSON(value []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.
type Image ¶
type Image struct { Name string Source string Command string Deployment DeploymentSettings Links []Link Environment []Environment Ports []Port Expose []FromIntOrString Volumes []Volume VolumesFrom []string }
An Image ultimately represents the deployed Docker image.
func (Image) MarshalJSON ¶
MarshalJSON is used to strip out empty/default value structs when marshalling images to JSON.
type Link ¶
type Link struct { Service string `json:"service,omitempty"` Alias string `json:"alias,omitempty"` }
Link represents each Link that will be passed to the Docker run command.
func (Link) MarshalJSON ¶
MarshalJSON produces the JSON expected by the adapter Which is different than the json sent by the client
type Manager ¶
type Manager interface { ListDeployments() ([]DeploymentResponseLite, error) GetFullDeployment(int) (DeploymentResponseFull, error) GetDeployment(int) (DeploymentResponseLite, error) DeleteDeployment(int) error CreateDeployment(DeploymentBlueprint) (DeploymentResponseLite, error) ReDeploy(int) (DeploymentResponseLite, error) FetchMetadata() (Metadata, error) }
A Manager is responsible for coordinating deployment related use cases.
func MakeDeploymentManager ¶
func MakeDeploymentManager(s DeploymentStore, c adapter.Client, v string) Manager
MakeDeploymentManager returns a deploymentManager hydrated with a persister and adapter client.
type Metadata ¶
type Metadata struct { Agent AgentMetadata `json:"agent"` Adapter interface{} `json:"adapter"` }
Metadata contains general meta data for both the Agent and the Adapter.
type Port ¶
type Port struct { HostPort FromIntOrString `json:"host_port,omitempty"` ContainerPort FromIntOrString `json:"container_port,omitempty"` }
Port represents each Port mapping that will be passed to the Docker run command.
func (Port) MarshalJSON ¶
MarshalJSON produces the JSON expected by the adapter Which is different than the json sent by the client
type Service ¶
Service represents each service in a Deployment and contains the ID, as well as its state.
type Status ¶
type Status struct {
Services []Service `json:"services"`
}
Status contains information for health of each service in a Deployment.
type Template ¶
type Template struct { Name string `json:"name,omitempty"` Images []Image `json:"images,omitempty"` }
A Template is the 2nd level entity in the DeploymentBlueprint scheme. It contains all the necessary information for a deployment post override logic.
type Volume ¶
type Volume struct { ContainerPath string `json:"container_path"` HostPath string `json:"host_path"` }
A Volume represents each Volume mapping that will be passed to the Docker run command.
func (Volume) MarshalJSON ¶
MarshalJSON produces the JSON expected by the adapter Which is different than the json sent by the client