kafka

package
v0.0.0-...-5b77582 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConsumer

func InitConsumer(name string, addresses []string, topic, kafkaVersion, consumerName string)

初始化Kafka消费者

func InitProducer

func InitProducer(name string, addresses []string)

初始化Kafka生产者

func KConsume

func KConsume(ctx context.Context, name, topic string, fn func([]byte) error) error

func SendKMsg

func SendKMsg(name string, msg *Msg) error

Types

type Msg

type Msg struct {
	Key   string
	Topic string
	Data  interface{}
}

Jump to

Keyboard shortcuts

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