File: metadata.go

package info (click to toggle)
golang-github-segmentio-kafka-go 0.4.49%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,292 kB
  • sloc: sh: 17; makefile: 10
file content (52 lines) | stat: -rw-r--r-- 2,000 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package metadata

import "github.com/segmentio/kafka-go/protocol"

func init() {
	protocol.Register(&Request{}, &Response{})
}

type Request struct {
	TopicNames                         []string `kafka:"min=v0,max=v8,nullable"`
	AllowAutoTopicCreation             bool     `kafka:"min=v4,max=v8"`
	IncludeClusterAuthorizedOperations bool     `kafka:"min=v8,max=v8"`
	IncludeTopicAuthorizedOperations   bool     `kafka:"min=v8,max=v8"`
}

func (r *Request) ApiKey() protocol.ApiKey { return protocol.Metadata }

type Response struct {
	ThrottleTimeMs              int32            `kafka:"min=v3,max=v8"`
	Brokers                     []ResponseBroker `kafka:"min=v0,max=v8"`
	ClusterID                   string           `kafka:"min=v2,max=v8,nullable"`
	ControllerID                int32            `kafka:"min=v1,max=v8"`
	Topics                      []ResponseTopic  `kafka:"min=v0,max=v8"`
	ClusterAuthorizedOperations int32            `kafka:"min=v8,max=v8"`
}

func (r *Response) ApiKey() protocol.ApiKey { return protocol.Metadata }

type ResponseBroker struct {
	NodeID int32  `kafka:"min=v0,max=v8"`
	Host   string `kafka:"min=v0,max=v8"`
	Port   int32  `kafka:"min=v0,max=v8"`
	Rack   string `kafka:"min=v1,max=v8,nullable"`
}

type ResponseTopic struct {
	ErrorCode                 int16               `kafka:"min=v0,max=v8"`
	Name                      string              `kafka:"min=v0,max=v8"`
	IsInternal                bool                `kafka:"min=v1,max=v8"`
	Partitions                []ResponsePartition `kafka:"min=v0,max=v8"`
	TopicAuthorizedOperations int32               `kafka:"min=v8,max=v8"`
}

type ResponsePartition struct {
	ErrorCode       int16   `kafka:"min=v0,max=v8"`
	PartitionIndex  int32   `kafka:"min=v0,max=v8"`
	LeaderID        int32   `kafka:"min=v0,max=v8"`
	LeaderEpoch     int32   `kafka:"min=v7,max=v8"`
	ReplicaNodes    []int32 `kafka:"min=v0,max=v8"`
	IsrNodes        []int32 `kafka:"min=v0,max=v8"`
	OfflineReplicas []int32 `kafka:"min=v5,max=v8"`
}