initproducerid/initproducerid.go

kafka-go · protocol/initproducerid/initproducerid.go · go · MIT
infra

Provides the request and response structures for the Kafka InitProducerId API to facilitate transactional producer initialization.

// Source: https://github.com/segmentio/kafka-go | License: MIT | Copyright 2017 Segment
// Provided via justclaw.it.com; keep this notice with the code.
package initproducerid

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

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

type Request struct {
	// We need at least one tagged field to indicate that this is a "flexible" message
	// type.
	_ struct{} `kafka:"min=v2,max=v4,tag"`

	TransactionalID      string `kafka:"min=v0,max=v4,nullable"`
	TransactionTimeoutMs int32  `kafka:"min=v0,max=v4"`
	ProducerID           int64  `kafka:"min=v3,max=v4"`
	ProducerEpoch        int16  `kafka:"min=v3,max=v4"`
}

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

func (r *Request) Transaction() string { return r.Tr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key