kafka

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewKafkaClient

func NewKafkaClient(ctx context.Context, opts ...Option) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateTopic

func (c *Client) CreateTopic(ctx context.Context, topic string, partitions, replication int) error

func (*Client) DeleteTopics

func (c *Client) DeleteTopics(ctx context.Context, topics ...string) error

func (*Client) ListTopics

func (c *Client) ListTopics() ([]string, error)

func (*Client) WriteMessages

func (c *Client) WriteMessages(ctx context.Context, topic string, msg ...kafka.Message) error

type Option

type Option func(*Options)

func WithAddress

func WithAddress(addr ...string) Option

func WithPlainSASL

func WithPlainSASL(userName, password string) Option

func WithSCRAMSASL

func WithSCRAMSASL(userName, password string) Option

func WithTopic

func WithTopic(topic string) Option

type Options

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

func NewKafkaDialer

func NewKafkaDialer(opts ...Option) (*kafka.Dialer, *Options)

type Producer

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

func NewDefaultProducer

func NewDefaultProducer(ctx context.Context, opts ...Option) (*Producer, error)

func (*Producer) Write

func (p *Producer) Write(ctx context.Context, msg ...kafka.Message) error

Jump to

Keyboard shortcuts

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