messengers

package
v0.0.0-...-de2e6a1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Offset  int64  `json:"offset"`
	Message string `json:"message"`
	Subject string `json:"subject"`
}

Message defines the format of a message.

type Messenger

type Messenger interface {
	// Check if the broker is reacheable.
	CanConnect() bool
	// Send sends a new message.
	Send(messageID, message string) error
	// Receive a new message from a specific subject.
	Receive(out chan<- Message)
}

Messenger is the standard interface for one of our messengers implementation.

func NewKafkaMessenger

func NewKafkaMessenger(ctx context.Context, brokers []string, topic, group string) Messenger

NewKafkaMessenger creates a new Kafka based messenger.

Jump to

Keyboard shortcuts

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