Merge pull request #214 from digitalocean/mregmi/add_proxy_protocol

add support for enable_proxy_protocol
This commit is contained in:
Manish Regmi 2019-03-18 11:38:05 -07:00 committed by GitHub
commit 5a9a6147a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,7 @@ type LoadBalancer struct {
Tag string `json:"tag,omitempty"`
Tags []string `json:"tags,omitempty"`
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"`
}
// String creates a human-readable description of a LoadBalancer.
@ -63,6 +64,7 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest {
DropletIDs: append([]int(nil), l.DropletIDs...),
Tag: l.Tag,
RedirectHttpToHttps: l.RedirectHttpToHttps,
EnableProxyProtocol: l.EnableProxyProtocol,
HealthCheck: l.HealthCheck,
}
@ -135,6 +137,7 @@ type LoadBalancerRequest struct {
Tag string `json:"tag,omitempty"`
Tags []string `json:"tags,omitempty"`
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"`
}
// String creates a human-readable description of a LoadBalancerRequest.

View File

@ -824,6 +824,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
Slug: "lon1",
},
RedirectHttpToHttps: true,
EnableProxyProtocol: true,
}
lb.DropletIDs = make([]int, 1, 2)
lb.DropletIDs[0] = 12345
@ -861,6 +862,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
},
DropletIDs: []int{12345},
RedirectHttpToHttps: true,
EnableProxyProtocol: true,
}
r := lb.AsRequest()