github.com/streamdal/segmentio-kafka-go@v0.4.47-streamdal/protocol/describeuserscramcredentials/describeuserscramcredentials.go (about) 1 package describeuserscramcredentials 2 3 import "github.com/segmentio/kafka-go/protocol" 4 5 func init() { 6 protocol.Register(&Request{}, &Response{}) 7 } 8 9 type Request struct { 10 // We need at least one tagged field to indicate that v2+ uses "flexible" 11 // messages. 12 _ struct{} `kafka:"min=v0,max=v0,tag"` 13 14 Users []RequestUser `kafka:"min=v0,max=v0"` 15 } 16 17 func (r *Request) ApiKey() protocol.ApiKey { return protocol.DescribeUserScramCredentials } 18 19 func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) { 20 return cluster.Brokers[cluster.Controller], nil 21 } 22 23 type RequestUser struct { 24 // We need at least one tagged field to indicate that v2+ uses "flexible" 25 // messages. 26 _ struct{} `kafka:"min=v0,max=v0,tag"` 27 28 Name string `kafka:"min=v0,max=v0,compact"` 29 } 30 31 type Response struct { 32 // We need at least one tagged field to indicate that v2+ uses "flexible" 33 // messages. 34 _ struct{} `kafka:"min=v0,max=v0,tag"` 35 36 ThrottleTimeMs int32 `kafka:"min=v0,max=v0"` 37 ErrorCode int16 `kafka:"min=v0,max=v0"` 38 ErrorMessage string `kafka:"min=v0,max=v0,nullable"` 39 Results []ResponseResult `kafka:"min=v0,max=v0"` 40 } 41 42 func (r *Response) ApiKey() protocol.ApiKey { return protocol.DescribeUserScramCredentials } 43 44 type ResponseResult struct { 45 // We need at least one tagged field to indicate that v2+ uses "flexible" 46 // messages. 47 _ struct{} `kafka:"min=v0,max=v0,tag"` 48 49 User string `kafka:"min=v0,max=v0,compact"` 50 ErrorCode int16 `kafka:"min=v0,max=v0"` 51 ErrorMessage string `kafka:"min=v0,max=v0,nullable"` 52 CredentialInfos []CredentialInfo `kafka:"min=v0,max=v0"` 53 } 54 55 type CredentialInfo struct { 56 // We need at least one tagged field to indicate that v2+ uses "flexible" 57 // messages. 58 _ struct{} `kafka:"min=v0,max=v0,tag"` 59 60 Mechanism int8 `kafka:"min=v0,max=v0"` 61 Iterations int32 `kafka:"min=v0,max=v0"` 62 } 63 64 var _ protocol.BrokerMessage = (*Request)(nil)