kmq

package module
v0.0.0-...-3e479b8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 7 Imported by: 0

README

kmq

📦 kmq 是 sarama 库的二次封装,简化使用方式

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KafkaV2_5_0_0 = sarama.V2_5_0_0

Functions

func Config

func Config(version sarama.KafkaVersion, nodes []string) (cfg *sarama.Config)

func NewAdmin

func NewAdmin(cfg *sarama.Config) (admin sarama.ClusterAdmin, cancel func(), e error)

func NewConfig

func NewConfig() (cfg *sarama.Config)

func NewConsumer

func NewConsumer(cfg *sarama.Config, topicDir, topic string) (offset int64,
	consumer sarama.PartitionConsumer,
	cancel func(),
	commit func(int64),
	e error)

Types

type Producer

type Producer struct {
	This sarama.AsyncProducer
}

func NewProducer

func NewProducer(cfg *sarama.Config) (producer Producer, cancel func(), e error)

func (*Producer) Input

func (producer *Producer) Input(topic string, data *[]byte) (e error)

func (*Producer) InputJson

func (producer *Producer) InputJson(topic string, data interface{}) (e error)

Jump to

Keyboard shortcuts

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