Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnableToSendMessage = errors.New("unable to send message")
ErrUnableToSendMessage occurs when the message could not be sent to the external queue (Apache Kafka, etc).
var ErrUnableToTranscodeMessage = errors.New("unable to transcode message")
ErrUnableToTranscodeMessage occurs when the content of the message could not be transcoded by Write() for output.
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer interface {
Close() error
}
Closer is an interface that defines the operations that Closer implementors must adhere to.
type ConsoleBEWriter ¶
type ConsoleBEWriter struct{}
ConsoleBEWriter is a simple Writer implementation..
func (*ConsoleBEWriter) Write ¶
func (bew *ConsoleBEWriter) Write(m Message) error
Write outputs the contents of Message to the console.
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is used to count the number of messages that the Listener has processed since it was started.
type KafkaBEWriter ¶
type KafkaBEWriter struct {
// contains filtered or unexported fields
}
KafkaBEWriter is an Apache Kafka mock Writer implementation..
func (*KafkaBEWriter) Close ¶
func (bew *KafkaBEWriter) Close() error
Close shuts down the producer and flushes any messages it may have buffered. You must call this function before a producer object passes out of scope, as it may otherwise leak memory. You must call this before calling Close on the underlying client.
func (*KafkaBEWriter) Write ¶
func (bew *KafkaBEWriter) Write(m Message) error
Write outputs the contents of Message to a Kafka topic.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager holds the properties needed by the business event logger. It is the receiver of utility methods for consumers.
func StartNewListener ¶
StartNewListener creates a new business event bus and adds a Writer to the WriterPool.
type Message ¶
type Message interface{}
Message is a high level interface that all Business Events must implement.
type MessageEnvelop ¶
MessageEnvelop wraps Message with additional info.
type StandardMessage ¶
StandardMessage is the first implementor of Message. This represents acts as a header for all Message's.
type Writer ¶
Writer is an interface that defines the operations that Writer implementors must adhere to. This is used by WriterPool.Write() to write the message contents.
type WriterPool ¶
WriterPool is a thread-safe pool of Writer's.
func (*WriterPool) AddWriter ¶
func (bewp *WriterPool) AddWriter(w Writer)
AddWriter adds a Writer to the pool of Writer's.
func (*WriterPool) String ¶
func (bewp *WriterPool) String() string
String is an implementation of Stringer.
func (*WriterPool) Write ¶
func (bewp *WriterPool) Write(m Message)
Writer iterates through the pool of Writer's and and calls Write() on each one of them in a thread-safe manner. Thread-safety is achieved independently per Writer.