describeuserscramcredentials.go 1.9 KB

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