Skip to content

Commit

Permalink
Merge pull request #11 from ShaneSaww/add-container-to-task
Browse files Browse the repository at this point in the history
Adding in the Container struct for tasks
  • Loading branch information
andygrunwald committed Aug 18, 2017
2 parents 01814b5 + 7ac8b28 commit 74f7adf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions types.go
Expand Up @@ -196,6 +196,30 @@ type Task struct {
State string `json:"state"`
Statuses []TaskStatus `json:"statuses"`
Discovery TaskDiscovery `json:"discovery"`
Container Container `json:"container"`
}

// Container represents one way a Mesos task can be ran
type Container struct {
Type string `json:"type"`
Docker Docker `json:"docker,omitempty"`
}

// Docker is one type of Container
type Docker struct {
Image string `json:"image"`
Network string `json:"network"`
PortMappings []PortMapping `json:"port_mappings"`
Priviledge bool `json:"priviledge"`
Parameters []Parameter `json:"parameters"`
ForcePullImage bool `json:"force_pull_image"`
}

// PortMapping represents how containers ports map to host ports
type PortMapping struct {
HostPort int `json:"host_port"`
ContainerPort int `json:"container_port"`
Protocol string `json:"protocol"`
}

// TaskDiscovery represents the dicovery information of a task
Expand Down

0 comments on commit 74f7adf

Please sign in to comment.