kafka

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchProduceRequest added in v1.1.0

type BatchProduceRequest struct {
	Async    bool
	Messages []*sarama.ProducerMessage
}

type BatchProduceResponse added in v1.1.0

type BatchProduceResponse struct{}

type Client

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

func New

func New(serviceName string, opts ...OptionFunc) (cli *Client, err error)

func (*Client) BatchProduce added in v1.1.0

func (cli *Client) BatchProduce(ctx context.Context, request BatchProduceRequest) (
	response BatchProduceResponse, err error,
)

func (*Client) ConsumeGroup added in v1.1.0

func (cli *Client) ConsumeGroup(p ConsumeGroupParams) (err error)

func (*Client) ConsumePartition added in v1.1.0

func (cli *Client) ConsumePartition(p *ConsumePartitionParams) (err error)

func (*Client) Produce

func (cli *Client) Produce(ctx context.Context, request ProduceRequest) (
	response ProduceResponse, err error,
)

func (*Client) Shutdown

func (cli *Client) Shutdown() (err error)

func (*Client) Stop added in v1.1.0

func (cli *Client) Stop() error

type ConsumeGroupParams added in v1.1.0

type ConsumeGroupParams struct {
	Ctx      context.Context
	Consumer ConsumerFunc
	GroupID  string
	Topics   []string
}

type ConsumePartitionParams added in v1.1.0

type ConsumePartitionParams struct {
	Ctx       context.Context
	Consumer  ConsumerFunc
	Topic     string
	GroupID   string
	Partition int32
	Offset    int64
}

type Consumer

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

func (*Consumer) Cleanup

func (c *Consumer) Cleanup(s sarama.ConsumerGroupSession) error

func (*Consumer) ConsumeClaim

func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*Consumer) Setup

type ConsumerFunc added in v1.1.0

type ConsumerFunc func(context.Context, *sarama.ConsumerMessage) (reject bool, err error)

type OptionFunc

type OptionFunc func(*options)

func WithConcurrent added in v1.1.0

func WithConcurrent(c int) OptionFunc

func WithConfig added in v1.1.0

func WithConfig(c *sarama.Config) OptionFunc

func WithLogger added in v1.1.0

func WithLogger(l logger.Logger) OptionFunc

func WithRefreshInterval added in v1.1.0

func WithRefreshInterval(t time.Duration) OptionFunc

type ProduceRequest added in v1.1.0

type ProduceRequest struct {
	Async   bool
	Message *sarama.ProducerMessage
}

type ProduceResponse added in v1.1.0

type ProduceResponse struct {
	Partition int32
	Offset    uint64
}

Jump to

Keyboard shortcuts

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