Documentation ¶
Index ¶
- func ConfigAdd(path string)
- func NewConsumer(ctx context.Context) (*kafka.Consumer, error)
- func NewConsumerWithConfigPath(ctx context.Context, path string) (*kafka.Consumer, error)
- func NewConsumerWithOptions(ctx context.Context, o *Options) (*kafka.Consumer, error)
- func NewProducer(ctx context.Context) (*kafka.Producer, error)
- func NewProducerWithConfigPath(ctx context.Context, path string) (*kafka.Producer, error)
- func NewProducerWithOptions(ctx context.Context, o *Options) (*kafka.Producer, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConsumer ¶
NewConsumer returns connection with default options.
func NewConsumerWithConfigPath ¶
NewConsumerWithConfigPath returns connection with options from config path.
func NewConsumerWithOptions ¶
NewConsumerWithOptions returns connection with options.
func NewProducer ¶
NewProducer returns connection with default options.
func NewProducerWithConfigPath ¶
NewProducerWithConfigPath returns connection with options from config path.
Types ¶
type Options ¶
type Options struct { Brokers string Log struct { Level string Enabled bool } Producer struct { Acks int Timeout struct { Request int Message int } Batch struct { Size int NumMessages int } } Consumer struct { GroupId string AutoOffsetReset string EnableAutoCommit bool Protocol string } }
Options kafka connection options.
func NewOptions ¶
NewOptions returns options from config file or environment vars.
func NewOptionsWithPath ¶
NewOptionsWithPath unmarshals a given key path into options and returns it.
Click to show internal directories.
Click to hide internal directories.