consumer

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Config

type Config struct {
	Name    string
	Brokers []string // 服务器列表
	SASL    struct {
		Enable   bool // 是否启用加密信息,没有密码的服务器不要设置为true,即使不填user和pass也连不上
		User     string
		Password string
	}
	GroupId string   // 消费组
	Topics  []string // topic
	Version string   // 驱动应该用什么版本的api与服务器对话,最好和服务器版本保持一致以避免怪问题
	Debug   bool
}

kafka 类型订阅点附加配置

type Message

type Message struct {
	Topic string
	Key   []byte
	Value []byte
}

type Subscriber

type Subscriber interface {
	Start() (err error)
	Stop() (err error)
	Output() chan interface{}
}

订阅器接口定义

func New

func New(conf Config) (ks Subscriber)

构建方法

Jump to

Keyboard shortcuts

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