kafka

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncProducer added in v1.6.0

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

func (*AsyncProducer) Produce added in v1.6.0

func (p *AsyncProducer) Produce(topic, value string)

type Consumer

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

func (*Consumer) Close

func (c *Consumer) Close()

func (*Consumer) Consume

func (c *Consumer) Consume(cb func(topic string, data []byte) bool) error

type Kafka

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

func Ins

func Ins(id ...string) *Kafka

返回 kafka 组件单例

func NewKafka

func NewKafka(connect []string, config *cluster.Config) *Kafka

实例化一个全新的 Kafka

func (*Kafka) AsyncProducer added in v1.6.0

func (q *Kafka) AsyncProducer() (*AsyncProducer, error)

func (*Kafka) Close added in v1.6.0

func (q *Kafka) Close() error

func (*Kafka) NewConsumer

func (q *Kafka) NewConsumer(group string, topics ...string) (*Consumer, error)

func (*Kafka) SyncProducer added in v1.6.0

func (q *Kafka) SyncProducer() (*SyncProducer, error)

type SyncProducer added in v1.6.0

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

func (*SyncProducer) Produce added in v1.6.0

func (p *SyncProducer) Produce(topic, value string) (partition int32, offset int64, err error)

Jump to

Keyboard shortcuts

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