Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for enable_proxy_protocol #214

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions load_balancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
}

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions load_balancers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -861,6 +862,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
},
DropletIDs: []int{12345},
RedirectHttpToHttps: true,
EnableProxyProtocol: true,
}

r := lb.AsRequest()
Expand Down