add support for enable_proxy_protocol

setting this to true will enable proxy protocol support in the loadbalancer
This commit is contained in:
Manish Regmi 2019-03-15 10:05:12 -07:00
parent 7a99fd7cb2
commit f829cd4f97
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()