Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SendOptions ¶ added in v1.0.15
type SendOptions func(msg *sarama.ProducerMessage)
func HeadersOption ¶ added in v1.0.15
func HeadersOption(headers []sarama.RecordHeader) SendOptions
func MetadataOption ¶ added in v1.0.15
func MetadataOption(data any) SendOptions
func PartitionKeyOption ¶ added in v1.0.15
func PartitionKeyOption(partitionKey string) SendOptions
type SyncProducer ¶
type SyncProducer struct {
// contains filtered or unexported fields
}
func NewSyncProducer ¶
func NewSyncProducer( cfg common.Config, logger *zap.Logger, opts ...SyncProducerOption, ) (*SyncProducer, error)
func (*SyncProducer) Close ¶
func (sp *SyncProducer) Close() error
func (*SyncProducer) Send ¶
func (sp *SyncProducer) Send(topic string, message []byte, opts ...SendOptions) error
type SyncProducerOption ¶
type SyncProducerOption func(sp *SyncProducer)
func ConfigOption ¶
func ConfigOption(cfg *sarama.Config) SyncProducerOption
Click to show internal directories.
Click to hide internal directories.