kafkav2

package
v0.0.0-...-9146478 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	NewProducer(c ProducerConfig, options ...ProducerOption) (writer.Writer, error)
	Servers() string
}

Interface .

type Message

type Message struct {
	Topic string
	Data  []byte
	Key   []byte
}

Message .

type Producer

type Producer interface {
	writer.Writer
}

Producer .

type ProducerConfig

type ProducerConfig struct {
	Topic       string        `file:"topic"`
	Parallelism uint64        `file:"parallelism"  default:"3" env:"PROVIDER_KAFKA_V2_PRODUCER_PARALLELISM"`
	Async       bool          `file:"async" default:"true" env:"PROVIDER_KAFKA_V2_PRODUCER_ASYNC"`
	Timeout     time.Duration `file:"timeout" default:"30s" env:"PROVIDER_KAFKA_V2_PRODUCER_TIMEOUT"`
	Batch       struct {
		Size      int           `file:"size" default:"100" env:"PROVIDER_KAFKA_V2_PRODUCER_BATCH_SIZE"`
		SizeBytes int64         `file:"size_bytes" default:"1048576" env:"PROVIDER_KAFKA_V2_PRODUCER_BATCH_SIZE_BYTES"`
		Timeout   time.Duration `file:"timeout" default:"800ms" env:"PROVIDER_KAFKA_V2_PRODUCER_BATCH_TIMEOUT"`
	} `file:"batch"`
}

ProducerConfig .

type ProducerOption

type ProducerOption interface {
	// contains filtered or unexported methods
}

ProducerOption .

func WithAsyncWriteErrorHandler

func WithAsyncWriteErrorHandler(eh func(error) error) ProducerOption

WithAsyncWriteErrorHandler .

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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