producer

package
v0.0.0-...-d002785 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageEncoder

type MessageEncoder func(string, sarama.Encoder, proto.Message) (*sarama.ProducerMessage, error)

MessageEncoder defines the encoding from topic, key, proto.Message to sarama.ProducerMessage

type Producer

type Producer interface {
	Run()
	Write(proto.Message)
	Stop()
}

Producer forwards messages recvd on a channel to kafka.

func New

func New(topic string, notifsChan chan proto.Message, client sarama.Client, key sarama.Encoder,
	encoder MessageEncoder) (
	Producer, error)

New creates new Kafka producer

Jump to

Keyboard shortcuts

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