sasl_authenticate_request.go 718 B

123456789101112131415161718192021222324252627282930313233
  1. package sarama
  2. type SaslAuthenticateRequest struct {
  3. SaslAuthBytes []byte
  4. }
  5. // APIKeySASLAuth is the API key for the SaslAuthenticate Kafka API
  6. const APIKeySASLAuth = 36
  7. func (r *SaslAuthenticateRequest) encode(pe packetEncoder) error {
  8. return pe.putBytes(r.SaslAuthBytes)
  9. }
  10. func (r *SaslAuthenticateRequest) decode(pd packetDecoder, version int16) (err error) {
  11. r.SaslAuthBytes, err = pd.getBytes()
  12. return err
  13. }
  14. func (r *SaslAuthenticateRequest) key() int16 {
  15. return APIKeySASLAuth
  16. }
  17. func (r *SaslAuthenticateRequest) version() int16 {
  18. return 0
  19. }
  20. func (r *SaslAuthenticateRequest) headerVersion() int16 {
  21. return 1
  22. }
  23. func (r *SaslAuthenticateRequest) requiredVersion() KafkaVersion {
  24. return V1_0_0_0
  25. }