msgbus

package
v0.0.0-...-2303e52 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeHandler

type ConsumeHandler interface {
	Handler(topic string, data []byte)
}

Attention: resouce conflict

type Consumer

type Consumer struct {
	sync.Mutex

	PartitionConsumerList []sarama.PartitionConsumer
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(kafkaUrl string) (*Consumer, error)

func (*Consumer) Close

func (c *Consumer) Close() error

func (*Consumer) ConsumeTopic

func (c *Consumer) ConsumeTopic(group, topic string, handler ConsumeHandler) error

type SyncProducer

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

func NewSyncProducer

func NewSyncProducer(kafkaUrl string) (*SyncProducer, error)

func (*SyncProducer) Close

func (sp *SyncProducer) Close() error

func (*SyncProducer) SendMessage

func (sp *SyncProducer) SendMessage(topic string, data []byte) error

Jump to

Keyboard shortcuts

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