From 0682c1f2b08b06732e73b652ddab75420e0b2cc5 Mon Sep 17 00:00:00 2001 From: ssmith-sahnow Date: Wed, 16 Aug 2017 10:45:09 -0700 Subject: [PATCH 1/2] Adding in the Container struct for tasks --- types.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/types.go b/types.go index 1cbc064..0b69f1d 100644 --- a/types.go +++ b/types.go @@ -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"` + Netowrk 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 From 7ac8b280ce7fffa739a346e559defde84548bcec Mon Sep 17 00:00:00 2001 From: Shane Smith-Sahnow Date: Thu, 17 Aug 2017 08:59:01 -0700 Subject: [PATCH 2/2] updating typo in struct name --- types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types.go b/types.go index 0b69f1d..322abd5 100644 --- a/types.go +++ b/types.go @@ -208,7 +208,7 @@ type Container struct { // Docker is one type of Container type Docker struct { Image string `json:"image"` - Netowrk string `json:"network"` + Network string `json:"network"` PortMappings []PortMapping `json:"port_mappings"` Priviledge bool `json:"priviledge"` Parameters []Parameter `json:"parameters"`