github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/protocol/alteruserscramcredentials/alteruserscramcredentials.go (about)

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