source

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 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 CommitMode added in v0.2.1

type CommitMode int

CommitMode is a Kafka source commit mode.

const (
	// CommitAuto commits messages automatically.
	CommitAuto CommitMode = iota

	// CommitManual commits messages manually.
	CommitManual
)

type Opt added in v0.2.1

type Opt func(o *Opts)

Opt is a Kafka source option.

func WithBufferSize added in v0.2.1

func WithBufferSize(size int) Opt

WithBufferSize configures the buffer size for a kafka source.

type Opts added in v0.2.1

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

Opts is a set of options for a kafka source.

func DefaultOpts added in v0.2.1

func DefaultOpts() *Opts

DefaultOpts is the default options for a kafka source.

func (*Opts) Configure added in v0.2.1

func (o *Opts) Configure(opts ...Opt)

Configure is a function that configures a kafka source.

type Source

type Source[K, V any] struct {
	// contains filtered or unexported fields
}

Source is a Kafka source.

func WithContext

func WithContext[K, V any](ctx context.Context, r *kgo.Reader, key codec.Decoder[K], value codec.Decoder[V], keyEncoder codec.Encoder[K], opts ...Opt) *Source[K, V]

WithContext is a constructor for a kafka source with a cancellation context.

func (*Source[K, V]) Commit

func (s *Source[K, V]) Commit(msgs ...msg.Message[K, V]) error

Commit is a Kafka source commit.

func (*Source[K, V]) Error

func (s *Source[K, V]) Error() error

Error is a Kafka source error.

func (*Source[K, V]) Messages

func (s *Source[K, V]) Messages() chan msg.Message[K, V]

Message is a Kafka source message.

Jump to

Keyboard shortcuts

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