kafka

package
v0.0.0-...-1bf96ee Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicLogTrace string = "logTrace"
)

Variables

This section is empty.

Functions

func Init

func Init()

func SendMessage

func SendMessage(topic string, data string)

send message

Types

type KafkaConsumer

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

func (*KafkaConsumer) Init

func (self *KafkaConsumer) Init() error

func (*KafkaConsumer) StartKafkaListen

func (self *KafkaConsumer) StartKafkaListen(listenMsg func(*sarama.ConsumerMessage)) error

注意该方法是非阻塞的,如果调用了该方法,并且没有其他的阻塞方法,记得手动阻塞他

type KafkaProducer

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

func (*KafkaProducer) Close

func (self *KafkaProducer) Close() error

func (*KafkaProducer) Init

func (self *KafkaProducer) Init() error

func (*KafkaProducer) SendMessage

func (self *KafkaProducer) SendMessage(topic string, data []byte) error

Jump to

Keyboard shortcuts

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