confluent

package
v1.0.0-dev.145 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func NewConsumer

func NewConsumer(ctx context.Context) (*kafka.Consumer, error)

NewConsumer returns connection with default options.

func NewConsumerWithConfigPath

func NewConsumerWithConfigPath(ctx context.Context, path string) (*kafka.Consumer, error)

NewConsumerWithConfigPath returns connection with options from config path.

func NewConsumerWithOptions

func NewConsumerWithOptions(ctx context.Context, o *Options) (*kafka.Consumer, error)

NewConsumerWithOptions returns connection with options.

func NewProducer

func NewProducer(ctx context.Context) (*kafka.Producer, error)

NewProducer returns connection with default options.

func NewProducerWithConfigPath

func NewProducerWithConfigPath(ctx context.Context, path string) (*kafka.Producer, error)

NewProducerWithConfigPath returns connection with options from config path.

func NewProducerWithOptions

func NewProducerWithOptions(ctx context.Context, o *Options) (*kafka.Producer, error)

NewProducerWithOptions returns connection with options.

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

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals a given key path into options and returns it.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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