producer

package
v0.0.0-...-4418484 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger logger.Logger = log.New(ioutil.Discard, "[Producer] ", log.LstdFlags)

Functions

func NewMessage

func NewMessage(topic string, data []byte) (msg *sarama.ProducerMessage)

Types

type Config

type Config struct {
	Name    string
	Brokers []string // 服务器列表
	SASL    struct {
		Enable   bool // 是否启用加密信息,没有密码的服务器不要设置为true,即使不填user和pass也连不上
		User     string
		Password string
	}

	ReturnSuc  bool   // 打印发送成功的信息
	WaitForAll bool   // 所有kafka节点都要收到消息才继续
	Version    string // 驱动应该用什么版本的api与服务器对话,最好和服务器版本保持一致以避免怪问题
	Debug      bool
}

type Publisher

type Publisher interface {
	Start() (err error)
	Stop() (err error)
	Input() chan interface{}
}

func New

func New(conf Config) (p Publisher)

Jump to

Keyboard shortcuts

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