github.com/hack0072008/kafka-go@v1.0.1/protocol/metadata/metadata.go (about)

     1  package metadata
     2  
     3  import "github.com/hack0072008/kafka-go/protocol"
     4  
     5  func init() {
     6  	protocol.Register(&Request{}, &Response{})
     7  }
     8  
     9  type Request struct {
    10  	TopicNames                         []string `kafka:"min=v0,max=v8,nullable"`
    11  	AllowAutoTopicCreation             bool     `kafka:"min=v4,max=v8"`
    12  	IncludeClusterAuthorizedOperations bool     `kafka:"min=v8,max=v8"`
    13  	IncludeTopicAuthorizedOperations   bool     `kafka:"min=v8,max=v8"`
    14  }
    15  
    16  func (r *Request) ApiKey() protocol.ApiKey { return protocol.Metadata }
    17  
    18  type Response struct {
    19  	ThrottleTimeMs              int32            `kafka:"min=v3,max=v8"`
    20  	Brokers                     []ResponseBroker `kafka:"min=v0,max=v8"`
    21  	ClusterID                   string           `kafka:"min=v2,max=v8,nullable"`
    22  	ControllerID                int32            `kafka:"min=v1,max=v8"`
    23  	Topics                      []ResponseTopic  `kafka:"min=v0,max=v8"`
    24  	ClusterAuthorizedOperations int32            `kafka:"min=v8,max=v8"`
    25  }
    26  
    27  func (r *Response) ApiKey() protocol.ApiKey { return protocol.Metadata }
    28  
    29  type ResponseBroker struct {
    30  	NodeID int32  `kafka:"min=v0,max=v8"`
    31  	Host   string `kafka:"min=v0,max=v8"`
    32  	Port   int32  `kafka:"min=v0,max=v8"`
    33  	Rack   string `kafka:"min=v1,max=v8,nullable"`
    34  }
    35  
    36  type ResponseTopic struct {
    37  	ErrorCode                 int16               `kafka:"min=v0,max=v8"`
    38  	Name                      string              `kafka:"min=v0,max=v8"`
    39  	IsInternal                bool                `kafka:"min=v1,max=v8"`
    40  	Partitions                []ResponsePartition `kafka:"min=v0,max=v8"`
    41  	TopicAuthorizedOperations int32               `kafka:"min=v8,max=v8"`
    42  }
    43  
    44  type ResponsePartition struct {
    45  	ErrorCode       int16   `kafka:"min=v0,max=v8"`
    46  	PartitionIndex  int32   `kafka:"min=v0,max=v8"`
    47  	LeaderID        int32   `kafka:"min=v0,max=v8"`
    48  	LeaderEpoch     int32   `kafka:"min=v7,max=v8"`
    49  	ReplicaNodes    []int32 `kafka:"min=v0,max=v8"`
    50  	IsrNodes        []int32 `kafka:"min=v0,max=v8"`
    51  	OfflineReplicas []int32 `kafka:"min=v5,max=v8"`
    52  }