stream

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2018 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NewConsumer() Consumer
	NewProducer() Producer
	NewConsumerAndProducer() (Consumer, Producer)
}

Client interface to be implemented by different streamclients.

type Consumer

type Consumer interface {
	Messages() <-chan *Message
	Close() error
}

Consumer interface to be implemented by different streamclients.

type Message

type Message struct {
	Value     []byte
	Key       []byte
	Topic     string
	Timestamp time.Time
	// contains filtered or unexported fields
}

Message send to or received from a stream.

func NewMessageFromKafka

func NewMessageFromKafka(msg *sarama.ConsumerMessage, c *cluster.Consumer) *Message

NewMessageFromKafka creates a new message with required Kafka metadata.

func (*Message) Done

func (m *Message) Done()

Done tells the consumer a message has been processed, and should not be send again.

type Producer

type Producer interface {
	Messages() chan<- *Message
	Close() error
	PartitionKey(func(msg *Message) []byte)
}

Producer interface to be implemented by different streamclients.

Jump to

Keyboard shortcuts

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