kafka

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Name = "kafka"

Name is the name registered for kafka

Variables

This section is empty.

Functions

func MustNewProducer

func MustNewProducer(c *queue.Conf) queue.Pusher

func MustNewQueue

func MustNewQueue(c *queue.Conf) (queue.MessageQueue, error)

func NewConsumer

func NewConsumer(c *queue.Conf) (queue.MessageQueue, error)

func NewProducer

func NewProducer(c *queue.Conf) (queue.Pusher, error)

func WrapError

func WrapError(err error) error

Types

type Consumer

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

func (*Consumer) Close added in v0.1.1

func (c *Consumer) Close() error

func (*Consumer) Name added in v0.1.1

func (c *Consumer) Name() string

func (*Consumer) Subscribe added in v0.1.1

func (c *Consumer) Subscribe(topic string, handler queue.ConsumeHandle, opts ...queue.SubscribeOption) (queue.Subscriber, error)

type KafkaMessageTextMapCarrier

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

func (*KafkaMessageTextMapCarrier) Get

func (carrier *KafkaMessageTextMapCarrier) Get(key string) string

Get returns the value associated with the passed key.

func (*KafkaMessageTextMapCarrier) Keys

func (carrier *KafkaMessageTextMapCarrier) Keys() []string

Keys lists the keys stored in this carrier.

func (*KafkaMessageTextMapCarrier) Set

func (carrier *KafkaMessageTextMapCarrier) Set(key string, value string)

Set stores the key-value pair.

type Producer

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

Producer 生产者

func (*Producer) Close

func (p *Producer) Close() error

func (*Producer) Name

func (p *Producer) Name() string

func (*Producer) Push

func (p *Producer) Push(ctx context.Context, topic string, key, value []byte) error

func (*Producer) PushWithPartition added in v0.1.1

func (p *Producer) PushWithPartition(ctx context.Context, topic string, key, value []byte, partition int32) error

type Subscriber added in v0.1.1

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

func (*Subscriber) Options added in v0.1.1

func (s *Subscriber) Options() queue.SubscribeOptions

Options .

func (*Subscriber) Topic added in v0.1.1

func (s *Subscriber) Topic() string

Topic .

func (*Subscriber) Unsubscribe added in v0.1.1

func (s *Subscriber) Unsubscribe(removeFromManager bool) error

Unsubscribe .

Jump to

Keyboard shortcuts

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