Skip to content

Commit

Permalink
feat(load-balancer-rule): add load balancer ref (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikadix authored Nov 28, 2023
1 parent 64e0b2b commit 1fe7076
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/load_balancer_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type LoadBalancerRule struct {
CheckRise int `json:"check_rise,omitempty"`
CheckTimeout int `json:"check_timeout,omitempty"`
CheckHTTPStatuses HTTPStatuses `json:"check_http_statuses,omitempty"`
LoadBalancer *LoadBalancerRef `json:"load_balancer,omitempty"`
}

func (lbr *LoadBalancerRule) Ref() LoadBalancerRuleRef {
Expand Down
3 changes: 3 additions & 0 deletions core/load_balancer_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func TestLoadBalancerRule_JSONMarshalling(t *testing.T) {
CheckRise: 12,
CheckTimeout: 3,
CheckHTTPStatuses: HTTPStatusesAll2xx,
LoadBalancer: &LoadBalancerRef{
ID: "yet another abitrary string",
},
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"check_protocol": "HTTP",
"check_rise": 12,
"check_timeout": 3,
"check_http_statuses": "2"
"check_http_statuses": "2",
"load_balancer": {
"id": "yet another abitrary string"
}
}

0 comments on commit 1fe7076

Please sign in to comment.