Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f68080

Browse files
authored
feat: add ProtocolType to ListGroupsResponseGroup (#1403)
* feat: add ProtocolType to ListGroupsResponseGroup* Add test for expected ProtocolType in ListGroupsReponse
1 parentd851127 commit3f68080

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

‎listgroups.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ type ListGroupsResponseGroup struct {
3131

3232
// Coordinator is the ID of the coordinator broker for the group.
3333
Coordinatorint
34+
35+
// The group protocol type (eg "consumer", "connect")
36+
ProtocolTypestring
3437
}
3538

3639
func (c*Client)ListGroups(
@@ -48,8 +51,9 @@ func (c *Client) ListGroups(
4851

4952
for_,apiGroupInfo:=rangeapiResp.Groups {
5053
resp.Groups=append(resp.Groups,ListGroupsResponseGroup{
51-
GroupID:apiGroupInfo.GroupID,
52-
Coordinator:int(apiGroupInfo.BrokerID),
54+
GroupID:apiGroupInfo.GroupID,
55+
Coordinator:int(apiGroupInfo.BrokerID),
56+
ProtocolType:apiGroupInfo.ProtocolType,
5357
})
5458
}
5559

‎listgroups_test.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,21 @@ func TestClientListGroups(t *testing.T) {
9696
)
9797
}
9898
hasGroup:=false
99+
hasProtocol:=false
99100
for_,group:=rangeresp.Groups {
100101
ifgroup.GroupID==gid {
101102
hasGroup=true
103+
ifgroup.ProtocolType=="consumer" {
104+
hasProtocol=true
105+
}
102106
break
103107
}
104108
}
105109

106110
if!hasGroup {
107111
t.Error("Group not found in list")
108112
}
113+
if!hasProtocol {
114+
t.Error("Group does not have expected protocol type")
115+
}
109116
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp