Merge pull request #4580 from thockin/plural_20_endpoints

Part 2 of plural ports: make endpoints a struct
This commit is contained in:
Brendan Burns
2015-02-20 15:42:19 -08:00
33 changed files with 584 additions and 132 deletions

View File

@@ -745,12 +745,25 @@ type Service struct {
}
// Endpoints is a collection of endpoints that implement the actual service, for example:
// Name: "mysql", Endpoints: ["10.10.1.1:1909", "10.10.2.2:8834"]
// Name: "mysql", Endpoints: [{"ip": "10.10.1.1", "port": 1909}, {"ip": "10.10.2.2", "port": 8834}]
type Endpoints struct {
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
Endpoints []string `json:"endpoints,omitempty"`
// Optional: The IP protocol for these endpoints. Supports "TCP" and
// "UDP". Defaults to "TCP".
Protocol Protocol `json:"protocol,omitempty"`
Endpoints []Endpoint `json:"endpoints,omitempty"`
}
// Endpoint is a single IP endpoint of a service.
type Endpoint struct {
// Required: The IP of this endpoint.
// TODO: This should allow hostname or IP, see #4447.
IP string `json:"ip"`
// Required: The destination port to access.
Port int `json:"port"`
}
// EndpointsList is a list of endpoints.