saslauthenticate.go 600 B

12345678910111213141516171819202122
  1. package saslauthenticate
  2. import "github.com/segmentio/kafka-go/protocol"
  3. func init() {
  4. protocol.Register(&Request{}, &Response{})
  5. }
  6. type Request struct {
  7. AuthBytes []byte `kafka:"min=v0,max=v1"`
  8. }
  9. func (r *Request) ApiKey() protocol.ApiKey { return protocol.SaslAuthenticate }
  10. type Response struct {
  11. ErrorCode int16 `kafka:"min=v0,max=v1"`
  12. ErrorMessage string `kafka:"min=v0,max=v1,nullable"`
  13. AuthBytes []byte `kafka:"min=v0,max=v1"`
  14. SessionLifetimeMs int64 `kafka:"min=v1,max=v1"`
  15. }
  16. func (r *Response) ApiKey() protocol.ApiKey { return protocol.SaslAuthenticate }