kafka

package
v1.1.0-beta.17 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelperModule

func HelperModule(extraOptions fx.Option) fx.Option

HelperModule returns fx module for initialization of helper to start NATS client for handlers.

The module is only loaded once.

Types

type ErrorLogger

type ErrorLogger struct {
}

func (*ErrorLogger) Printf

func (l *ErrorLogger) Printf(msg string, args ...interface{})

type Helper

type Helper struct {
	// contains filtered or unexported fields
}

Helper assists in creating event handlers.

func NewDefaultHelper

func NewDefaultHelper(ctx context.Context, handler *cloudevents.HandlerWrapper) *Helper

NewDefaultHelper returns a new Helper with default options.

func NewHelper

func NewHelper(ctx context.Context, options *Options,
	handler *cloudevents.HandlerWrapper) *Helper

NewHelper returns a new Helper with options.

func (*Helper) Start

func (h *Helper) Start()

type Logger

type Logger struct {
}

func (*Logger) Printf

func (l *Logger) Printf(msg string, args ...interface{})

type Options

type Options struct {
	Brokers          []string
	Subjects         []string
	GroupId          string
	Concurrency      int
	QueueCapacity    int
	MinBytes         int
	MaxBytes         int
	StartOffset      int64
	ReadBatchTimeout time.Duration
	MaxWait          time.Duration
}

Options can be used to create customized handler.

func DefaultOptions

func DefaultOptions() (*Options, error)

DefaultOptions returns options based in config.

Jump to

Keyboard shortcuts

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