confluent

package
v1.0.0-dev.92 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T any](consumer *kafka.Consumer) function.CmdFunc[T]

New returns CmdFunc for cloudevents command.

Types

type Helper

type Helper[T any] struct {
	// contains filtered or unexported fields
}

Helper assists in creating event handlers.

func NewHelper

func NewHelper[T any](consumer *kafka.Consumer, handler function.Handler[T]) *Helper[T]

NewHelper returns a new Helper with default options.

func NewHelperWithOptions

func NewHelperWithOptions[T any](consumer *kafka.Consumer, handler function.Handler[T], options *Options) *Helper[T]

NewHelperWithOptions returns a new Helper with options.

func (*Helper[T]) Start

func (h *Helper[T]) Start()

type Options

type Options struct {
	Topics  []string
	TimeOut time.Duration
}

Options can be used to create customized handler.

func DefaultOptions

func DefaultOptions() (*Options, error)

DefaultOptions returns options based in config.

type Subscriber

type Subscriber[T any] struct {
	// contains filtered or unexported fields
}

Subscriber represents a subscriber listener.

func NewSubscriber

func NewSubscriber[T any](consumer *kafka.Consumer, handler function.Handler[T], topics []string, timeOut time.Duration) *Subscriber[T]

NewSubscriber returns a subscriber listener.

func (*Subscriber[T]) Subscribe

func (l *Subscriber[T]) Subscribe(ctx context.Context) error

Subscribe subscribes to a particular subject in the listening subscriber's queue.

Jump to

Keyboard shortcuts

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