forked from IBM/sarama
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete_groups_request.go
More file actions
46 lines (37 loc) · 876 Bytes
/
delete_groups_request.go
File metadata and controls
46 lines (37 loc) · 876 Bytes
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
package sarama
type DeleteGroupsRequest struct {
Version int16
Groups []string
}
func (r *DeleteGroupsRequest) encode(pe packetEncoder) error {
return pe.putStringArray(r.Groups)
}
func (r *DeleteGroupsRequest) decode(pd packetDecoder, version int16) (err error) {
r.Groups, err = pd.getStringArray()
return
}
func (r *DeleteGroupsRequest) key() int16 {
return 42
}
func (r *DeleteGroupsRequest) version() int16 {
return r.Version
}
func (r *DeleteGroupsRequest) headerVersion() int16 {
return 1
}
func (r *DeleteGroupsRequest) isValidVersion() bool {
return r.Version >= 0 && r.Version <= 1
}
func (r *DeleteGroupsRequest) requiredVersion() KafkaVersion {
switch r.Version {
case 1:
return V2_0_0_0
case 0:
return V1_1_0_0
default:
return V2_0_0_0
}
}
func (r *DeleteGroupsRequest) AddGroup(group string) {
r.Groups = append(r.Groups, group)
}