kafka

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dissector dissecting

Functions

func NewDissector

func NewDissector() api.Dissector

func ReadResponse

func ReadResponse(r io.Reader, tcpID *api.TcpID, counterPair *api.CounterPair, captureTime time.Time, emitter api.Emitter, reqResMatcher *requestResponseMatcher) (err error)

Types

type AbortedTransactionsV4

type AbortedTransactionsV4 struct {
	ProducerId  int32 `json:"producerId"`
	FirstOffset int32 `json:"firstOffset"`
}

type ApiKey

type ApiKey int16
const (
	Produce                     ApiKey = 0
	Fetch                       ApiKey = 1
	ListOffsets                 ApiKey = 2
	Metadata                    ApiKey = 3
	LeaderAndIsr                ApiKey = 4
	StopReplica                 ApiKey = 5
	UpdateMetadata              ApiKey = 6
	ControlledShutdown          ApiKey = 7
	OffsetCommit                ApiKey = 8
	OffsetFetch                 ApiKey = 9
	FindCoordinator             ApiKey = 10
	JoinGroup                   ApiKey = 11
	Heartbeat                   ApiKey = 12
	LeaveGroup                  ApiKey = 13
	SyncGroup                   ApiKey = 14
	DescribeGroups              ApiKey = 15
	ListGroups                  ApiKey = 16
	SaslHandshake               ApiKey = 17
	ApiVersions                 ApiKey = 18
	CreateTopics                ApiKey = 19
	DeleteTopics                ApiKey = 20
	DeleteRecords               ApiKey = 21
	InitProducerId              ApiKey = 22
	OffsetForLeaderEpoch        ApiKey = 23
	AddPartitionsToTxn          ApiKey = 24
	AddOffsetsToTxn             ApiKey = 25
	EndTxn                      ApiKey = 26
	WriteTxnMarkers             ApiKey = 27
	TxnOffsetCommit             ApiKey = 28
	DescribeAcls                ApiKey = 29
	CreateAcls                  ApiKey = 30
	DeleteAcls                  ApiKey = 31
	DescribeConfigs             ApiKey = 32
	AlterConfigs                ApiKey = 33
	AlterReplicaLogDirs         ApiKey = 34
	DescribeLogDirs             ApiKey = 35
	SaslAuthenticate            ApiKey = 36
	CreatePartitions            ApiKey = 37
	CreateDelegationToken       ApiKey = 38
	RenewDelegationToken        ApiKey = 39
	ExpireDelegationToken       ApiKey = 40
	DescribeDelegationToken     ApiKey = 41
	DeleteGroups                ApiKey = 42
	ElectLeaders                ApiKey = 43
	IncrementalAlterConfigs     ApiKey = 44
	AlterPartitionReassignments ApiKey = 45
	ListPartitionReassignments  ApiKey = 46
	OffsetDelete                ApiKey = 47
	DescribeClientQuotas        ApiKey = 48
	AlterClientQuotas           ApiKey = 49
)

func ReadRequest

func ReadRequest(r io.Reader, tcpID *api.TcpID, counterPair *api.CounterPair, captureTime time.Time, reqResMatcher *requestResponseMatcher) (apiKey ApiKey, apiVersion int16, err error)

func (ApiKey) String

func (k ApiKey) String() string

type ApiVersionsRequestV0

type ApiVersionsRequestV0 struct{}

type ApiVersionsRequestV3

type ApiVersionsRequestV3 struct {
	ClientSoftwareName    string `json:"clientSoftwareName"`
	ClientSoftwareVersion string `json:"clientSoftwareVersion"`
}

type ApiVersionsResponseApiKey

type ApiVersionsResponseApiKey struct {
	ApiKey     int16 `json:"apiKey"`
	MinVersion int16 `json:"minVersion"`
	MaxVersion int16 `json:"maxVersion"`
}

type ApiVersionsResponseV0

type ApiVersionsResponseV0 struct {
	ErrorCode int16                       `json:"errorCode"`
	ApiKeys   []ApiVersionsResponseApiKey `json:"apiKeys"`
}

type ApiVersionsResponseV1

type ApiVersionsResponseV1 struct {
	ErrorCode      int16                       `json:"errorCode"`
	ApiKeys        []ApiVersionsResponseApiKey `json:"apiKeys"` // FIXME: `confluent-kafka-python` causes memory leak
	ThrottleTimeMs int32                       `json:"throttleTimeMs"`
}

type AssignmentsV0

type AssignmentsV0 struct {
	PartitionIndex int32   `json:"partitionIndex"`
	BrokerIds      []int32 `json:"brokerIds"`
}

type Broker

type Broker struct {
	ID   int32
	Host string
	Port int32
	Rack string
}

type BrokerV0

type BrokerV0 struct {
	NodeId int32  `json:"nodeId"`
	Host   string `json:"host"`
	Port   int32  `json:"port"`
}

type BrokerV1

type BrokerV1 struct {
	NodeId int32  `json:"nodeId"`
	Host   string `json:"host"`
	Port   int32  `json:"port"`
	Rack   string `json:"rack"`
}

type Compression

type Compression = compress.Compression

type CompressionCodec

type CompressionCodec = compress.Codec

type CreateTopicsRequestConfigsV0

type CreateTopicsRequestConfigsV0 struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type CreateTopicsRequestTopicV0

type CreateTopicsRequestTopicV0 struct {
	Name              string                         `json:"name"`
	NumPartitions     int32                          `json:"numPartitions"`
	ReplicationFactor int16                          `json:"replicationFactor"`
	Assignments       []AssignmentsV0                `json:"assignments"`
	Configs           []CreateTopicsRequestConfigsV0 `json:"configs"`
}

type CreateTopicsRequestV0

type CreateTopicsRequestV0 struct {
	Topics    []CreateTopicsRequestTopicV0 `json:"topics"`
	TimeoutMs int32                        `json:"timeoutMs"`
}

type CreateTopicsRequestV1

type CreateTopicsRequestV1 struct {
	Topics       []CreateTopicsRequestTopicV0 `json:"topics"`
	TimeoutMs    int32                        `json:"timeoutMs"`
	ValidateOnly bool                         `json:"validateOnly"`
}

type CreateTopicsResponseConfigsV5

type CreateTopicsResponseConfigsV5 struct {
	Name         string `json:"name"`
	Value        string `json:"value"`
	ReadOnly     bool   `json:"readOnly"`
	ConfigSource int8   `json:"configSource"`
	IsSensitive  bool   `json:"isSensitive"`
}

type CreateTopicsResponseTopicV0

type CreateTopicsResponseTopicV0 struct {
	Name      string `json:"name"`
	ErrorCode int16  `json:"errorCode"`
}

type CreateTopicsResponseTopicV1

type CreateTopicsResponseTopicV1 struct {
	Name         string `json:"name"`
	ErrorCode    int16  `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
}

type CreateTopicsResponseTopicV5

type CreateTopicsResponseTopicV5 struct {
	Name              string                          `json:"name"`
	ErrorCode         int16                           `json:"errorCode"`
	ErrorMessage      string                          `json:"errorMessage"`
	NumPartitions     int32                           `json:"numPartitions"`
	ReplicationFactor int16                           `json:"replicationFactor"`
	Configs           []CreateTopicsResponseConfigsV5 `json:"configs"`
}

type CreateTopicsResponseTopicV7

type CreateTopicsResponseTopicV7 struct {
	Name              string                          `json:"name"`
	TopicID           UUID                            `json:"topicID"`
	ErrorCode         int16                           `json:"errorCode"`
	ErrorMessage      string                          `json:"errorMessage"`
	NumPartitions     int32                           `json:"numPartitions"`
	ReplicationFactor int16                           `json:"replicationFactor"`
	Configs           []CreateTopicsResponseConfigsV5 `json:"configs"`
}

type CreateTopicsResponseV0

type CreateTopicsResponseV0 struct {
	Topics []CreateTopicsResponseTopicV0 `json:"topics"`
}

type CreateTopicsResponseV1

type CreateTopicsResponseV1 struct {
	Topics []CreateTopicsResponseTopicV1 `json:"topics"`
}

type CreateTopicsResponseV2

type CreateTopicsResponseV2 struct {
	ThrottleTimeMs int32                         `json:"throttleTimeMs"`
	Topics         []CreateTopicsResponseTopicV1 `json:"topics"`
}

type CreateTopicsResponseV5

type CreateTopicsResponseV5 struct {
	ThrottleTimeMs int32                         `json:"throttleTimeMs"`
	Topics         []CreateTopicsResponseTopicV5 `json:"topics"`
}

type CreateTopicsResponseV7

type CreateTopicsResponseV7 struct {
	ThrottleTimeMs int32                         `json:"throttleTimeMs"`
	Topics         []CreateTopicsResponseTopicV7 `json:"topics"`
}

type DeleteTopicsReponseResponseV0

type DeleteTopicsReponseResponseV0 struct {
	Name      string `json:"name"`
	ErrorCode int16  `json:"errorCode"`
}

type DeleteTopicsReponseResponseV5

type DeleteTopicsReponseResponseV5 struct {
	Name         string `json:"name"`
	ErrorCode    int16  `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
}

type DeleteTopicsReponseResponseV6

type DeleteTopicsReponseResponseV6 struct {
	Name         string `json:"name"`
	TopicID      UUID   `json:"topicID"`
	ErrorCode    int16  `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
}

type DeleteTopicsReponseV0

type DeleteTopicsReponseV0 struct {
	Responses []DeleteTopicsReponseResponseV0 `json:"responses"`
}

type DeleteTopicsReponseV1

type DeleteTopicsReponseV1 struct {
	ThrottleTimeMs int32                           `json:"throttleTimeMs"`
	Responses      []DeleteTopicsReponseResponseV0 `json:"responses"`
}

type DeleteTopicsReponseV5

type DeleteTopicsReponseV5 struct {
	ThrottleTimeMs int32                           `json:"throttleTimeMs"`
	Responses      []DeleteTopicsReponseResponseV5 `json:"responses"`
}

type DeleteTopicsReponseV6

type DeleteTopicsReponseV6 struct {
	ThrottleTimeMs int32                           `json:"throttleTimeMs"`
	Responses      []DeleteTopicsReponseResponseV6 `json:"responses"`
}

type DeleteTopicsRequestTopicV6

type DeleteTopicsRequestTopicV6 struct {
	Name string `json:"name"`
	UUID UUID   `json:"uuid"`
}

type DeleteTopicsRequestV0

type DeleteTopicsRequestV0 struct {
	TopicNames []string `json:"topicNames"`
	TimeoutMs  int32    `json:"timeoutMs"`
}

type DeleteTopicsRequestV6

type DeleteTopicsRequestV6 struct {
	Topics    []DeleteTopicsRequestTopicV6 `json:"topics"`
	TimeoutMs int32                        `json:"timeoutMs"`
}

type FetchPartitionV0

type FetchPartitionV0 struct {
	Partition         int32 `json:"partition"`
	FetchOffset       int64 `json:"fetchOffset"`
	PartitionMaxBytes int32 `json:"partitionMaxBytes"`
}

type FetchPartitionV5

type FetchPartitionV5 struct {
	Partition         int32 `json:"partition"`
	FetchOffset       int64 `json:"fetchOffset"`
	LogStartOffset    int64 `json:"logStartOffset"`
	PartitionMaxBytes int32 `json:"partitionMaxBytes"`
}

type FetchPartitionV9

type FetchPartitionV9 struct {
	Partition          int32 `json:"partition"`
	CurrentLeaderEpoch int32 `json:"currentLeaderEpoch"`
	FetchOffset        int64 `json:"fetchOffset"`
	LogStartOffset     int64 `json:"logStartOffset"`
	PartitionMaxBytes  int32 `json:"partitionMaxBytes"`
}

type FetchRequestV0

type FetchRequestV0 struct {
	ReplicaId int32          `json:"replicaId"`
	MaxWaitMs int32          `json:"maxWaitMs"`
	MinBytes  int32          `json:"minBytes"`
	Topics    []FetchTopicV0 `json:"topics"`
}

type FetchRequestV11

type FetchRequestV11 struct {
	ReplicaId           int32                 `json:"replicaId"`
	MaxWaitMs           int32                 `json:"maxWaitMs"`
	MinBytes            int32                 `json:"minBytes"`
	MaxBytes            int32                 `json:"maxBytes"`
	IsolationLevel      int8                  `json:"isolationLevel"`
	SessionId           int32                 `json:"sessionId"`
	SessionEpoch        int32                 `json:"sessionEpoch"`
	Topics              []FetchTopicV9        `json:"topics"`
	ForgottenTopicsData ForgottenTopicsDataV7 `json:"forgottenTopicsData"`
	RackId              string                `json:"rackId"`
}

type FetchRequestV3

type FetchRequestV3 struct {
	ReplicaId int32          `json:"replicaId"`
	MaxWaitMs int32          `json:"maxWaitMs"`
	MinBytes  int32          `json:"minBytes"`
	MaxBytes  int32          `json:"maxBytes"`
	Topics    []FetchTopicV0 `json:"topics"`
}

type FetchRequestV4

type FetchRequestV4 struct {
	ReplicaId      int32          `json:"replicaId"`
	MaxWaitMs      int32          `json:"maxWaitMs"`
	MinBytes       int32          `json:"minBytes"`
	MaxBytes       int32          `json:"maxBytes"`
	IsolationLevel int8           `json:"isolationLevel"`
	Topics         []FetchTopicV0 `json:"topics"`
}

type FetchRequestV5

type FetchRequestV5 struct {
	ReplicaId      int32          `json:"replicaId"`
	MaxWaitMs      int32          `json:"maxWaitMs"`
	MinBytes       int32          `json:"minBytes"`
	MaxBytes       int32          `json:"maxBytes"`
	IsolationLevel int8           `json:"isolationLevel"`
	Topics         []FetchTopicV5 `json:"topics"`
}

type FetchRequestV7

type FetchRequestV7 struct {
	ReplicaId           int32                 `json:"replicaId"`
	MaxWaitMs           int32                 `json:"maxWaitMs"`
	MinBytes            int32                 `json:"minBytes"`
	MaxBytes            int32                 `json:"maxBytes"`
	IsolationLevel      int8                  `json:"isolationLevel"`
	SessionId           int32                 `json:"sessionId"`
	SessionEpoch        int32                 `json:"sessionEpoch"`
	Topics              []FetchTopicV5        `json:"topics"`
	ForgottenTopicsData ForgottenTopicsDataV7 `json:"forgottenTopicsData"`
}

type FetchRequestV9

type FetchRequestV9 struct {
	ReplicaId           int32                 `json:"replicaId"`
	MaxWaitMs           int32                 `json:"maxWaitMs"`
	MinBytes            int32                 `json:"minBytes"`
	MaxBytes            int32                 `json:"maxBytes"`
	IsolationLevel      int8                  `json:"isolationLevel"`
	SessionId           int32                 `json:"sessionId"`
	SessionEpoch        int32                 `json:"sessionEpoch"`
	Topics              []FetchTopicV9        `json:"topics"`
	ForgottenTopicsData ForgottenTopicsDataV7 `json:"forgottenTopicsData"`
}

type FetchResponseV0

type FetchResponseV0 struct {
	Responses []ResponseFetchV0 `json:"responses"`
}

type FetchResponseV1

type FetchResponseV1 struct {
	ThrottleTimeMs int32             `json:"throttleTimeMs"`
	Responses      []ResponseFetchV0 `json:"responses"`
}

type FetchResponseV11

type FetchResponseV11 struct {
	ThrottleTimeMs int32             `json:"throttleTimeMs"`
	ErrorCode      int16             `json:"errorCode"`
	SessionId      int32             `json:"sessionId"`
	Responses      []ResponseFetchV5 `json:"responses"`
}

type FetchResponseV4

type FetchResponseV4 struct {
	ThrottleTimeMs int32             `json:"throttleTimeMs"`
	Responses      []ResponseFetchV4 `json:"responses"`
}

type FetchResponseV5

type FetchResponseV5 struct {
	ThrottleTimeMs int32             `json:"throttleTimeMs"`
	Responses      []ResponseFetchV5 `json:"responses"`
}

type FetchResponseV7

type FetchResponseV7 struct {
	ThrottleTimeMs int32             `json:"throttleTimeMs"`
	ErrorCode      int16             `json:"errorCode"`
	SessionId      int32             `json:"sessionId"`
	Responses      []ResponseFetchV5 `json:"responses"`
}

type FetchTopicV0

type FetchTopicV0 struct {
	Topic      string             `json:"topic"`
	Partitions []FetchPartitionV0 `json:"partitions"`
}

type FetchTopicV5

type FetchTopicV5 struct {
	Topic      string             `json:"topic"`
	Partitions []FetchPartitionV5 `json:"partitions"`
}

type FetchTopicV9

type FetchTopicV9 struct {
	Topic      string             `json:"topic"`
	Partitions []FetchPartitionV9 `json:"partitions"`
}

type ForgottenTopicsDataV7

type ForgottenTopicsDataV7 struct {
	Topic      string  `json:"topic"`
	Partitions []int32 `json:"partitions"`
}

type GroupMessage

type GroupMessage interface {
	// Returns the group configured on the message.
	Group() string
}

GroupMessage is an extension of the Message interface implemented by some request types to inform the program that they should be routed to a group coordinator.

type KafkaPayload

type KafkaPayload struct {
	Data interface{}
}

func (KafkaPayload) MarshalJSON

func (h KafkaPayload) MarshalJSON() ([]byte, error)

type KafkaPayloader

type KafkaPayloader interface {
	MarshalJSON() ([]byte, error)
}

type KafkaWrapper

type KafkaWrapper struct {
	Method  string      `json:"method"`
	Url     string      `json:"url"`
	Details interface{} `json:"details"`
}

type ListOffsetsRequestPartitionV0

type ListOffsetsRequestPartitionV0 struct {
	PartitionIndex int32 `json:"partitionIndex"`
	Timestamp      int64 `json:"timestamp"`
	MaxNumOffsets  int32 `json:"maxNumOffsets"`
}

type ListOffsetsRequestPartitionV1

type ListOffsetsRequestPartitionV1 struct {
	PartitionIndex int32 `json:"partitionIndex"`
	Timestamp      int64 `json:"timestamp"`
}

type ListOffsetsRequestPartitionV4

type ListOffsetsRequestPartitionV4 struct {
	PartitionIndex     int32 `json:"partitionIndex"`
	CurrentLeaderEpoch int32 `json:"currentLeaderEpoch"`
	Timestamp          int64 `json:"timestamp"`
}

type ListOffsetsRequestTopicV0

type ListOffsetsRequestTopicV0 struct {
	Name       string                          `json:"name"`
	Partitions []ListOffsetsRequestPartitionV0 `json:"partitions"`
}

type ListOffsetsRequestTopicV1

type ListOffsetsRequestTopicV1 struct {
	Name       string                          `json:"name"`
	Partitions []ListOffsetsRequestPartitionV1 `json:"partitions"`
}

type ListOffsetsRequestTopicV4

type ListOffsetsRequestTopicV4 struct {
	Name       string                          `json:"name"`
	Partitions []ListOffsetsRequestPartitionV4 `json:"partitions"`
}

type ListOffsetsRequestV0

type ListOffsetsRequestV0 struct {
	ReplicaId int32                       `json:"replicaId"`
	Topics    []ListOffsetsRequestTopicV0 `json:"topics"`
}

type ListOffsetsRequestV1

type ListOffsetsRequestV1 struct {
	ReplicaId int32                       `json:"replicaId"`
	Topics    []ListOffsetsRequestTopicV1 `json:"topics"`
}

type ListOffsetsRequestV2

type ListOffsetsRequestV2 struct {
	ReplicaId      int32                       `json:"replicaId"`
	IsolationLevel int8                        `json:"isolationLevel"`
	Topics         []ListOffsetsRequestTopicV1 `json:"topics"`
}

type ListOffsetsRequestV4

type ListOffsetsRequestV4 struct {
	ReplicaId int32                       `json:"replicaId"`
	Topics    []ListOffsetsRequestTopicV4 `json:"topics"`
}

type ListOffsetsResponsePartitionV0

type ListOffsetsResponsePartitionV0 struct {
	PartitionIndex  int32 `json:"partitionIndex"`
	ErrorCode       int16 `json:"errorCode"`
	OldStyleOffsets int64 `json:"oldStyleOffsets"`
}

type ListOffsetsResponsePartitionV1

type ListOffsetsResponsePartitionV1 struct {
	PartitionIndex int32 `json:"partitionIndex"`
	ErrorCode      int16 `json:"errorCode"`
	Timestamp      int64 `json:"timestamp"`
	Offset         int64 `json:"offset"`
}

type ListOffsetsResponsePartitionV4

type ListOffsetsResponsePartitionV4 struct {
	PartitionIndex int32 `json:"partitionIndex"`
	ErrorCode      int16 `json:"errorCode"`
	Timestamp      int64 `json:"timestamp"`
	Offset         int64 `json:"offset"`
	LeaderEpoch    int32 `json:"leaderEpoch"`
}

type ListOffsetsResponseTopicV0

type ListOffsetsResponseTopicV0 struct {
	Name       string                           `json:"name"`
	Partitions []ListOffsetsResponsePartitionV0 `json:"partitions"`
}

type ListOffsetsResponseTopicV1

type ListOffsetsResponseTopicV1 struct {
	Name       string                           `json:"name"`
	Partitions []ListOffsetsResponsePartitionV1 `json:"partitions"`
}

type ListOffsetsResponseTopicV4

type ListOffsetsResponseTopicV4 struct {
	Name       string                           `json:"name"`
	Partitions []ListOffsetsResponsePartitionV4 `json:"partitions"`
}

type ListOffsetsResponseV0

type ListOffsetsResponseV0 struct {
	Topics []ListOffsetsResponseTopicV0 `json:"topics"`
}

type ListOffsetsResponseV1

type ListOffsetsResponseV1 struct {
	Topics []ListOffsetsResponseTopicV1 `json:"topics"`
}

type ListOffsetsResponseV2

type ListOffsetsResponseV2 struct {
	ThrottleTimeMs int32                        `json:"throttleTimeMs"`
	Topics         []ListOffsetsResponseTopicV1 `json:"topics"`
}

type ListOffsetsResponseV4

type ListOffsetsResponseV4 struct {
	Topics []ListOffsetsResponseTopicV4 `json:"topics"`
}

type Merger

type Merger interface {
	// Given a list of message and associated results, merge them back into a
	// response (or an error). The results must be either Message or error
	// values, other types should trigger a panic.
	Merge(messages []Message, results []interface{}) (Message, error)
}

Merger is an interface implemented by messages which can merge multiple results into one response.

type Message

type Message interface {
	ApiKey() ApiKey
}

Message is an interface implemented by all request and response types of the kafka protocol.

This interface is used mostly as a safe-guard to provide a compile-time check for values passed to functions dealing kafka message types.

type MessageBlock

type MessageBlock struct {
	Offset int64      `json:"offset"`
	Msg    *MessageV0 `json:"msg"`
}

MessageBlock represents a part of request with message

type MessageSet

type MessageSet struct {
	PartialTrailingMessage bool            `json:"partialTrailingMessage"` // whether the set on the wire contained an incomplete trailing MessageBlock
	OverflowMessage        bool            `json:"overflowMessage"`        // whether the set on the wire contained an overflow message
	Messages               []*MessageBlock `json:"messages"`
}

MessageSet is a replacement for RecordBatch in older versions

type MessageV0

type MessageV0 struct {
	Codec            int8        `json:"codec"`            // codec used to compress the message contents
	CompressionLevel int         `json:"compressionLevel"` // compression level
	LogAppendTime    bool        `json:"logAppendTime"`    // the used timestamp is LogAppendTime
	Key              []byte      `json:"key"`              // the message key, may be nil
	Value            []byte      `json:"value"`            // the message contents
	Set              *MessageSet `json:"set"`              // the message set a message might wrap
	Version          int8        `json:"version"`          // v1 requires Kafka 0.10
	Timestamp        time.Time   `json:"timestamp"`        // the timestamp of the message (version 1+ only)
}

Message is a kafka message type

type MetadataRequestTopicV0

type MetadataRequestTopicV0 struct {
	Name string `json:"name"`
}

type MetadataRequestTopicV10

type MetadataRequestTopicV10 struct {
	Name string
	UUID UUID
}

type MetadataRequestV0

type MetadataRequestV0 struct {
	Topics []MetadataRequestTopicV0 `json:"topics"`
}

type MetadataRequestV10

type MetadataRequestV10 struct {
	Topics                             []MetadataRequestTopicV10 `json:"topics"`
	AllowAutoTopicCreation             bool                      `json:"allowAutoTopicCreation"`
	IncludeClusterAuthorizedOperations bool                      `json:"includeClusterAuthorizedOperations"`
	IncludeTopicAuthorizedOperations   bool                      `json:"includeTopicAuthorizedOperations"`
}

type MetadataRequestV11

type MetadataRequestV11 struct {
	Topics                           []MetadataRequestTopicV10 `json:"topics"`
	AllowAutoTopicCreation           bool                      `json:"allowAutoTopicCreation"`
	IncludeTopicAuthorizedOperations bool                      `json:"includeTopicAuthorizedOperations"`
}

type MetadataRequestV4

type MetadataRequestV4 struct {
	Topics                 []MetadataRequestTopicV0 `json:"topics"`
	AllowAutoTopicCreation bool                     `json:"allowAutoTopicCreation"`
}

type MetadataRequestV8

type MetadataRequestV8 struct {
	Topics                             []MetadataRequestTopicV0 `json:"topics"`
	AllowAutoTopicCreation             bool                     `json:"allowAutoTopicCreation"`
	IncludeClusterAuthorizedOperations bool                     `json:"includeClusterAuthorizedOperations"`
	IncludeTopicAuthorizedOperations   bool                     `json:"includeTopicAuthorizedOperations"`
}

type MetadataResponseV0

type MetadataResponseV0 struct {
	Brokers []BrokerV0 `json:"brokers"`
	Topics  []TopicV0  `json:"topics"`
}

type MetadataResponseV1

type MetadataResponseV1 struct {
	Brokers      []BrokerV1 `json:"brokers"`
	ControllerID int32      `json:"controllerID"`
	Topics       []TopicV1  `json:"topics"`
}

type MetadataResponseV10

type MetadataResponseV10 struct {
	ThrottleTimeMs              int32      `json:"throttleTimeMs"`
	Brokers                     []BrokerV1 `json:"brokers"`
	ClusterID                   string     `json:"clusterID"`
	ControllerID                int32      `json:"controllerID"`
	Topics                      []TopicV10 `json:"topics"`
	ClusterAuthorizedOperations int32      `json:"clusterAuthorizedOperations"`
}

type MetadataResponseV11

type MetadataResponseV11 struct {
	ThrottleTimeMs int32      `json:"throttleTimeMs"`
	Brokers        []BrokerV1 `json:"brokers"`
	ClusterID      string     `json:"clusterID"`
	ControllerID   int32      `json:"controllerID"`
	Topics         []TopicV10 `json:"topics"`
}

type MetadataResponseV2

type MetadataResponseV2 struct {
	Brokers      []BrokerV1 `json:"brokers"`
	ClusterID    string     `json:"clusterID"`
	ControllerID int32      `json:"controllerID"`
	Topics       []TopicV1  `json:"topics"`
}

type MetadataResponseV3

type MetadataResponseV3 struct {
	ThrottleTimeMs int32      `json:"throttleTimeMs"`
	Brokers        []BrokerV1 `json:"brokers"`
	ClusterID      string     `json:"clusterID"`
	ControllerID   int32      `json:"controllerID"`
	Topics         []TopicV1  `json:"topics"`
}

type MetadataResponseV5

type MetadataResponseV5 struct {
	ThrottleTimeMs int32      `json:"throttleTimeMs"`
	Brokers        []BrokerV1 `json:"brokers"`
	ClusterID      string     `json:"clusterID"`
	ControllerID   int32      `json:"controllerID"`
	Topics         []TopicV5  `json:"topics"`
}

type MetadataResponseV7

type MetadataResponseV7 struct {
	ThrottleTimeMs int32      `json:"throttleTimeMs"`
	Brokers        []BrokerV1 `json:"brokers"`
	ClusterID      string     `json:"clusterID"`
	ControllerID   int32      `json:"controllerID"`
	Topics         []TopicV7  `json:"topics"`
}

type MetadataResponseV8

type MetadataResponseV8 struct {
	ThrottleTimeMs              int32      `json:"throttleTimeMs"`
	Brokers                     []BrokerV1 `json:"brokers"`
	ClusterID                   string     `json:"clusterID"`
	ControllerID                int32      `json:"controllerID"`
	Topics                      []TopicV8  `json:"topics"`
	ClusterAuthorizedOperations int32      `json:"clusterAuthorizedOperations"`
}

type Partition

type Partition struct {
	ID       int32
	Error    int16
	Leader   int32
	Replicas []int32
	ISR      []int32
	Offline  []int32
}

type PartitionData

type PartitionData struct {
	Index   int32   `json:"index"`
	Unknown int32   `json:"unknown"`
	Records Records `json:"records"`
}

type PartitionResponseFetchV0

type PartitionResponseFetchV0 struct {
	Partition     int32   `json:"partition"`
	ErrorCode     int16   `json:"errorCode"`
	HighWatermark int64   `json:"highWatermark"`
	RecordSet     Records `json:"recordSet"`
}

type PartitionResponseFetchV11

type PartitionResponseFetchV11 struct {
	Partition            int32                 `json:"partition"`
	ErrorCode            int16                 `json:"errorCode"`
	HighWatermark        int64                 `json:"highWatermark"`
	LastStableOffset     int64                 `json:"lastStableOffset"`
	LogStartOffset       int64                 `json:"logStartOffset"`
	AbortedTransactions  AbortedTransactionsV4 `json:"abortedTransactions"`
	PreferredReadReplica int32                 `json:"preferredReadReplica"`
	RecordSet            Records               `json:"recordSet"`
}

type PartitionResponseFetchV4

type PartitionResponseFetchV4 struct {
	Partition           int32                 `json:"partition"`
	ErrorCode           int16                 `json:"errorCode"`
	HighWatermark       int64                 `json:"highWatermark"`
	LastStableOffset    int64                 `json:"lastStableOffset"`
	AbortedTransactions AbortedTransactionsV4 `json:"abortedTransactions"`
	RecordSet           Records               `json:"recordSet"`
}

type PartitionResponseFetchV5

type PartitionResponseFetchV5 struct {
	Partition           int32                 `json:"partition"`
	ErrorCode           int16                 `json:"errorCode"`
	HighWatermark       int64                 `json:"highWatermark"`
	LastStableOffset    int64                 `json:"lastStableOffset"`
	LogStartOffset      int64                 `json:"logStartOffset"`
	AbortedTransactions AbortedTransactionsV4 `json:"abortedTransactions"`
	RecordSet           Records               `json:"recordSet"`
}

type PartitionResponseV0

type PartitionResponseV0 struct {
	Index      int32 `json:"index"`
	ErrorCode  int16 `json:"errorCode"`
	BaseOffset int64 `json:"baseOffset"`
}

type PartitionResponseV2

type PartitionResponseV2 struct {
	Index           int32 `json:"index"`
	ErrorCode       int16 `json:"errorCode"`
	BaseOffset      int64 `json:"baseOffset"`
	LogAppendTimeMs int64 `json:"logAppendTimeMs"`
}

type PartitionResponseV5

type PartitionResponseV5 struct {
	Index           int32 `json:"index"`
	ErrorCode       int16 `json:"errorCode"`
	BaseOffset      int64 `json:"baseOffset"`
	LogAppendTimeMs int64 `json:"logAppendTimeMs"`
	LogStartOffset  int64 `json:"logStartOffset"`
}

type PartitionResponseV8

type PartitionResponseV8 struct {
	Index           int32        `json:"index"`
	ErrorCode       int16        `json:"errorCode"`
	BaseOffset      int64        `json:"baseOffset"`
	LogAppendTimeMs int64        `json:"logAppendTimeMs"`
	LogStartOffset  int64        `json:"logStartOffset"`
	RecordErrors    RecordErrors `json:"recordErrors"`
	ErrorMessage    string       `json:"errorMessage"`
}

type Partitions

type Partitions struct {
	Length        int32         `json:"length"`
	PartitionData PartitionData `json:"partitionData"`
}

type PartitionsV0

type PartitionsV0 struct {
	ErrorCode      int16 `json:"errorCode"`
	PartitionIndex int32 `json:"partitionIndex"`
	LeaderId       int32 `json:"leaderId"`
	ReplicaNodes   int32 `json:"replicaNodes"`
	IsrNodes       int32 `json:"isrNodes"`
}

type PartitionsV5

type PartitionsV5 struct {
	ErrorCode       int16 `json:"errorCode"`
	PartitionIndex  int32 `json:"partitionIndex"`
	LeaderId        int32 `json:"leaderId"`
	ReplicaNodes    int32 `json:"replicaNodes"`
	IsrNodes        int32 `json:"isrNodes"`
	OfflineReplicas int32 `json:"offlineReplicas"`
}

type PartitionsV7

type PartitionsV7 struct {
	ErrorCode       int16 `json:"errorCode"`
	PartitionIndex  int32 `json:"partitionIndex"`
	LeaderId        int32 `json:"leaderId"`
	LeaderEpoch     int32 `json:"leaderEpoch"`
	ReplicaNodes    int32 `json:"replicaNodes"`
	IsrNodes        int32 `json:"isrNodes"`
	OfflineReplicas int32 `json:"offlineReplicas"`
}

type PreparedMessage

type PreparedMessage interface {
	// Prepares the message before being sent to a kafka broker using the API
	// version passed as argument.
	Prepare(apiVersion int16)
}

PreparedMessage is an extension of the Message interface implemented by some request types which may need to run some pre-processing on their state before being sent.

type ProduceRequestV0

type ProduceRequestV0 struct {
	RequiredAcks RequiredAcks `json:"requiredAcks"`
	Timeout      int32        `json:"timeout"`
	TopicData    []TopicData  `json:"topicData"`
}

type ProduceRequestV3

type ProduceRequestV3 struct {
	TransactionalID string       `json:"transactionalID"`
	RequiredAcks    RequiredAcks `json:"requiredAcks"`
	Timeout         int32        `json:"timeout"`
	TopicData       []TopicData  `json:"topicData"`
}

type ProduceResponseV0

type ProduceResponseV0 struct {
	Responses []ResponseV0 `json:"responses"`
}

type ProduceResponseV1

type ProduceResponseV1 struct {
	Responses      []ResponseV0 `json:"responses"`
	ThrottleTimeMs int32        `json:"throttleTimeMs"`
}

type ProduceResponseV2

type ProduceResponseV2 struct {
	Responses      []ResponseV2 `json:"responses"`
	ThrottleTimeMs int32        `json:"throttleTimeMs"`
}

type ProduceResponseV5

type ProduceResponseV5 struct {
	Responses      []ResponseV5 `json:"responses"`
	ThrottleTimeMs int32        `json:"throttleTimeMs"`
}

type ProduceResponseV8

type ProduceResponseV8 struct {
	Responses      []ResponseV8 `json:"responses"`
	ThrottleTimeMs int32        `json:"throttleTimeMs"`
}

type RecordBatch

type RecordBatch struct {
	BaseOffset           int64      `json:"baseOffset"`
	BatchLength          int32      `json:"batchLength"`
	PartitionLeaderEpoch int32      `json:"partitionLeaderEpoch"`
	Magic                int8       `json:"magic"`
	Crc                  int32      `json:"crc"`
	Attributes           int16      `json:"attributes"`
	LastOffsetDelta      int32      `json:"lastOffsetDelta"`
	FirstTimestamp       int64      `json:"firstTimestamp"`
	MaxTimestamp         int64      `json:"maxTimestamp"`
	ProducerId           int64      `json:"producerId"`
	ProducerEpoch        int16      `json:"producerEpoch"`
	BaseSequence         int32      `json:"baseSequence"`
	Record               []RecordV0 `json:"record"`
}

RecordBatch are records from one kafka request

type RecordErrors

type RecordErrors struct {
	BatchIndex             int32  `json:"batchIndex"`
	BatchIndexErrorMessage string `json:"batchIndexErrorMessage"`
}

type RecordHeader

type RecordHeader struct {
	HeaderKeyLength   int8   `json:"headerKeyLength"`
	HeaderKey         string `json:"headerKey"`
	HeaderValueLength int8   `json:"headerValueLength"`
	Value             string `json:"value"`
}

type RecordV0

type RecordV0 struct {
	Unknown        int8           `json:"unknown"`
	Attributes     int8           `json:"attributes"`
	TimestampDelta int8           `json:"timestampDelta"`
	OffsetDelta    int8           `json:"offsetDelta"`
	KeyLength      int8           `json:"keyLength"`
	Key            string         `json:"key"`
	ValueLen       int8           `json:"valueLen"`
	Value          string         `json:"value"`
	Headers        []RecordHeader `json:"headers"`
}

Record is kafka record type

type Records

type Records struct {
	RecordBatch RecordBatch `json:"recordBatch"`
}

type Request

type Request struct {
	Size          int32       `json:"size"`
	ApiKeyName    string      `json:"apiKeyName"`
	ApiKey        ApiKey      `json:"apiKey"`
	ApiVersion    int16       `json:"apiVersion"`
	CorrelationID int32       `json:"correlationID"`
	ClientID      string      `json:"clientID"`
	Payload       interface{} `json:"payload"`
	CaptureTime   time.Time   `json:"captureTime"`
}

type RequestResponsePair

type RequestResponsePair struct {
	Request  Request
	Response Response
}

type RequiredAcks

type RequiredAcks int16
const (
	RequireNone RequiredAcks = 0
	RequireOne  RequiredAcks = 1
	RequireAll  RequiredAcks = -1
)

type Response

type Response struct {
	Size          int32       `json:"size"`
	CorrelationID int32       `json:"correlationID"`
	Payload       interface{} `json:"payload"`
	CaptureTime   time.Time   `json:"captureTime"`
}

type ResponseFetchV0

type ResponseFetchV0 struct {
	Topic              string                     `json:"topic"`
	PartitionResponses []PartitionResponseFetchV0 `json:"partitionResponses"`
}

type ResponseFetchV11

type ResponseFetchV11 struct {
	Topic              string                      `json:"topic"`
	PartitionResponses []PartitionResponseFetchV11 `json:"partitionResponses"`
}

type ResponseFetchV4

type ResponseFetchV4 struct {
	Topic              string                     `json:"topic"`
	PartitionResponses []PartitionResponseFetchV4 `json:"partitionResponses"`
}

type ResponseFetchV5

type ResponseFetchV5 struct {
	Topic              string                     `json:"topic"`
	PartitionResponses []PartitionResponseFetchV5 `json:"partitionResponses"`
}

type ResponseV0

type ResponseV0 struct {
	Name               string                `json:"name"`
	PartitionResponses []PartitionResponseV0 `json:"partitionResponses"`
}

type ResponseV2

type ResponseV2 struct {
	Name               string                `json:"name"`
	PartitionResponses []PartitionResponseV2 `json:"partitionResponses"`
}

type ResponseV5

type ResponseV5 struct {
	Name               string                `json:"name"`
	PartitionResponses []PartitionResponseV5 `json:"partitionResponses"`
}

type ResponseV8

type ResponseV8 struct {
	Name               string                `json:"name"`
	PartitionResponses []PartitionResponseV8 `json:"partitionResponses"`
}

type Topic

type Topic struct {
	Name       string
	Error      int16
	Partitions map[int32]Partition
}

type TopicData

type TopicData struct {
	Topic      string     `json:"topic"`
	Partitions Partitions `json:"partitions"`
}

type TopicV0

type TopicV0 struct {
	ErrorCode  int16          `json:"errorCode"`
	Name       string         `json:"name"`
	Partitions []PartitionsV0 `json:"partitions"`
}

type TopicV1

type TopicV1 struct {
	ErrorCode  int16          `json:"errorCode"`
	Name       string         `json:"name"`
	IsInternal bool           `json:"isInternal"`
	Partitions []PartitionsV0 `json:"partitions"`
}

type TopicV10

type TopicV10 struct {
	ErrorCode                 int16          `json:"errorCode"`
	Name                      string         `json:"name"`
	TopicID                   UUID           `json:"topicID"`
	IsInternal                bool           `json:"isInternal"`
	Partitions                []PartitionsV7 `json:"partitions"`
	TopicAuthorizedOperations int32          `json:"topicAuthorizedOperations"`
}

type TopicV5

type TopicV5 struct {
	ErrorCode  int16          `json:"errorCode"`
	Name       string         `json:"name"`
	IsInternal bool           `json:"isInternal"`
	Partitions []PartitionsV5 `json:"partitions"`
}

type TopicV7

type TopicV7 struct {
	ErrorCode  int16          `json:"errorCode"`
	Name       string         `json:"name"`
	IsInternal bool           `json:"isInternal"`
	Partitions []PartitionsV7 `json:"partitions"`
}

type TopicV8

type TopicV8 struct {
	ErrorCode                 int16          `json:"errorCode"`
	Name                      string         `json:"name"`
	IsInternal                bool           `json:"isInternal"`
	Partitions                []PartitionsV7 `json:"partitions"`
	TopicAuthorizedOperations int32          `json:"topicAuthorizedOperations"`
}

type UUID

type UUID struct {
	TimeLow          int32 `json:"timeLow"`
	TimeMid          int16 `json:"timeMid"`
	TimeHiAndVersion int16 `json:"timeHiAndVersion"`
	ClockSeq         int16 `json:"clockSeq"`
	NodePart1        int32 `json:"nodePart1"`
	NodePart22       int16 `json:"nodePart22"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL