-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
describe_groups_request.go
55 lines (47 loc) · 1.09 KB
/
describe_groups_request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package sarama
type DescribeGroupsRequest struct {
Version int16
Groups []string
IncludeAuthorizedOperations bool
}
func (r *DescribeGroupsRequest) encode(pe packetEncoder) error {
if err := pe.putStringArray(r.Groups); err != nil {
return err
}
if r.Version >= 3 {
pe.putBool(r.IncludeAuthorizedOperations)
}
return nil
}
func (r *DescribeGroupsRequest) decode(pd packetDecoder, version int16) (err error) {
r.Version = version
r.Groups, err = pd.getStringArray()
if err != nil {
return err
}
if r.Version >= 3 {
if r.IncludeAuthorizedOperations, err = pd.getBool(); err != nil {
return err
}
}
return nil
}
func (r *DescribeGroupsRequest) key() int16 {
return 15
}
func (r *DescribeGroupsRequest) version() int16 {
return r.Version
}
func (r *DescribeGroupsRequest) headerVersion() int16 {
return 1
}
func (r *DescribeGroupsRequest) requiredVersion() KafkaVersion {
switch r.Version {
case 1, 2, 3, 4:
return V2_3_0_0
}
return V0_9_0_0
}
func (r *DescribeGroupsRequest) AddGroup(group string) {
r.Groups = append(r.Groups, group)
}