producer

package
v0.0.0-...-f9573de Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	KafkaBrokers() []string
}

Config represents the configuration required for a consumer service

type DefaultProducerConfig

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

DefaultProducerConfig is a default Config implementation

func (DefaultProducerConfig) KafkaBrokers

func (c DefaultProducerConfig) KafkaBrokers() []string

KafkaBrokers implements Config.KafkaBrokers

type Message

type Message interface {
	Topic() string
	Key() sarama.Encoder
	Value() sarama.Encoder
}

Message ...

func NewByteMessage

func NewByteMessage(topic, key string, value []byte) Message

NewByteMessage returns a new Message

func NewStringMessage

func NewStringMessage(topic, key, value string) Message

NewStringMessage returns a new Message

type Producer

type Producer interface {
	Send(Message) (partition int32, offset int64, err error)
}

Producer ...

func New

func New(config Config) (Producer, error)

New ...

Jump to

Keyboard shortcuts

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