Skip to content

Commit 8bbfc02

Browse files
authored
Merge pull request #27 from jianxiaoguo/main
feat(gateways): add addresses field
2 parents 99a7fbf + 5a4d6cf commit 8bbfc02

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

api/gateways.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type Gateway struct {
1515
UUID string `json:"uuid,omitempty"`
1616
Name string `json:"name,omitempty"`
1717
Listeners []Listener `json:"listeners,omitempty"`
18+
Addresses []Address `json:"addresses,omitempty"`
1819
}
1920

2021
type Listener struct {
@@ -24,6 +25,11 @@ type Listener struct {
2425
AllowedRoutes interface{} `json:"allowedRoutes,omitempty"`
2526
}
2627

28+
type Address struct {
29+
Type string `json:"type,omitempty"`
30+
Value string `json:"value,omitempty"`
31+
}
32+
2733
// Gateways defines a collection of gateway objects.
2834
type Gateways []Gateway
2935

gateways/gateways_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ const gatewaysFixture string = `
3737
"protocol": "HTTPS",
3838
"allowedRoutes": {"namespaces": {"from": "All"}}
3939
}
40+
],
41+
"addresses": [
42+
{
43+
"type": "IPAddress",
44+
"value": "172.22.108.207"
45+
}
4046
]
4147
}
4248
]
@@ -121,6 +127,12 @@ func TestGatewaysList(t *testing.T) {
121127
AllowedRoutes: map[string]interface{}{"namespaces": map[string]interface{}{"from": "All"}},
122128
},
123129
},
130+
Addresses: []api.Address{
131+
{
132+
Type: "IPAddress",
133+
Value: "172.22.108.207",
134+
},
135+
},
124136
},
125137
}
126138
handler := fakeHTTPServer{}

0 commit comments

Comments
 (0)