alteruserscramcredentials.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package alteruserscramcredentials
  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. Deletions []RequestUserScramCredentialsDeletion `kafka:"min=v0,max=v0"`
  11. Upsertions []RequestUserScramCredentialsUpsertion `kafka:"min=v0,max=v0"`
  12. }
  13. func (r *Request) ApiKey() protocol.ApiKey { return protocol.AlterUserScramCredentials }
  14. func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) {
  15. return cluster.Brokers[cluster.Controller], nil
  16. }
  17. type RequestUserScramCredentialsDeletion struct {
  18. // We need at least one tagged field to indicate that v2+ uses "flexible"
  19. // messages.
  20. _ struct{} `kafka:"min=v0,max=v0,tag"`
  21. Name string `kafka:"min=v0,max=v0,compact"`
  22. Mechanism int8 `kafka:"min=v0,max=v0"`
  23. }
  24. type RequestUserScramCredentialsUpsertion struct {
  25. // We need at least one tagged field to indicate that v2+ uses "flexible"
  26. // messages.
  27. _ struct{} `kafka:"min=v0,max=v0,tag"`
  28. Name string `kafka:"min=v0,max=v0,compact"`
  29. Mechanism int8 `kafka:"min=v0,max=v0"`
  30. Iterations int32 `kafka:"min=v0,max=v0"`
  31. Salt []byte `kafka:"min=v0,max=v0,compact"`
  32. SaltedPassword []byte `kafka:"min=v0,max=v0,compact"`
  33. }
  34. type Response struct {
  35. // We need at least one tagged field to indicate that v2+ uses "flexible"
  36. // messages.
  37. _ struct{} `kafka:"min=v0,max=v0,tag"`
  38. ThrottleTimeMs int32 `kafka:"min=v0,max=v0"`
  39. Results []ResponseUserScramCredentials `kafka:"min=v0,max=v0"`
  40. }
  41. func (r *Response) ApiKey() protocol.ApiKey { return protocol.AlterUserScramCredentials }
  42. type ResponseUserScramCredentials struct {
  43. // We need at least one tagged field to indicate that v2+ uses "flexible"
  44. // messages.
  45. _ struct{} `kafka:"min=v0,max=v0,tag"`
  46. User string `kafka:"min=v0,max=v0,compact"`
  47. ErrorCode int16 `kafka:"min=v0,max=v0"`
  48. ErrorMessage string `kafka:"min=v0,max=v0,nullable"`
  49. }
  50. var _ protocol.BrokerMessage = (*Request)(nil)