Skip to content

Commit

Permalink
add tags to alterclientquotas types
Browse files Browse the repository at this point in the history
  • Loading branch information
petedannemann committed Jun 7, 2023
1 parent 10b8107 commit b5875a6
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions protocol/alterclientquotas/alterclientquotas.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,28 @@ func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) {
}

type Entry struct {
// We need at least one tagged field to indicate that this is a "flexible" message
// type.
_ struct{} `kafka:"min=v1,max=v1,tag"`
Entities []Entity `kafka:"min=v0,max=v1"`
Ops []Ops `kafka:"min=v0,max=v1"`
}

type Entity struct {
EntityType string `kafka:"min=v0,max=v0|min=v1,max=v1,compact"`
EntityName string `kafka:"min=v0,max=v0,nullable|min=v1,max=v1,nullable,compact"`
// We need at least one tagged field to indicate that this is a "flexible" message
// type.
_ struct{} `kafka:"min=v1,max=v1,tag"`
EntityType string `kafka:"min=v0,max=v0|min=v1,max=v1,compact"`
EntityName string `kafka:"min=v0,max=v0,nullable|min=v1,max=v1,nullable,compact"`
}

type Ops struct {
Key string `kafka:"min=v0,max=v0|min=v1,max=v1,compact"`
Value float64 `kafka:"min=v0,max=v1"`
Remove bool `kafka:"min=v0,max=v1"`
// We need at least one tagged field to indicate that this is a "flexible" message
// type.
_ struct{} `kafka:"min=v1,max=v1,tag"`
Key string `kafka:"min=v0,max=v0|min=v1,max=v1,compact"`
Value float64 `kafka:"min=v0,max=v1"`
Remove bool `kafka:"min=v0,max=v1"`
}

type Response struct {
Expand All @@ -48,6 +57,9 @@ type Response struct {
func (r *Response) ApiKey() protocol.ApiKey { return protocol.AlterClientQuotas }

type ResponseQuotas struct {
// We need at least one tagged field to indicate that this is a "flexible" message
// type.
_ struct{} `kafka:"min=v1,max=v1,tag"`
ErrorCode int16 `kafka:"min=v0,max=v1"`
ErrorMessage string `kafka:"min=v0,max=v1,nullable"`
Entities []Entity `kafka:"min=v0,max=v1"`
Expand Down

0 comments on commit b5875a6

Please sign in to comment.