Documentation ¶
Overview ¶
Package messaging is the parent package for implementations of various messaging clients, e.g. Kafka.
Index ¶
- Constants
- func ParseOpts(opts ...interface{}) (time.Duration, logging.Logger)
- func ToProtoMsgChan(ch chan ProtoMessage, opts ...interface{}) func(ProtoMessage)
- func ToProtoMsgErrChan(ch chan ProtoMessageErr, opts ...interface{}) func(ProtoMessageErr)
- type Mux
- type ProtoMessage
- type ProtoMessageErr
- type ProtoPublisher
- type ProtoWatcher
- type WithLoggerOpt
- type WithTimeoutOpt
Constants ¶
const DefaultMsgTimeout = 2 * time.Second
DefaultMsgTimeout for delivery of notification
Variables ¶
This section is empty.
Functions ¶
func ToProtoMsgChan ¶
func ToProtoMsgChan(ch chan ProtoMessage, opts ...interface{}) func(ProtoMessage)
ToProtoMsgChan allows to receive messages through channel instead of callback.
func ToProtoMsgErrChan ¶
func ToProtoMsgErrChan(ch chan ProtoMessageErr, opts ...interface{}) func(ProtoMessageErr)
ToProtoMsgErrChan allows to receive error messages through channel instead of callback.
Types ¶
type Mux ¶
type Mux interface { NewSyncPublisher(topic string) ProtoPublisher NewAsyncPublisher(topic string, successClb func(ProtoMessage), errorClb func(err ProtoMessageErr)) ProtoPublisher NewWatcher(subscriberName string) ProtoWatcher }
Mux defines API for the plugins that use access to kafka brokers.
type ProtoMessage ¶
type ProtoMessage interface { keyval.ProtoKvPair GetTopic() string }
ProtoMessage defines functions for inspection of a message receive from messaging system.
type ProtoMessageErr ¶
type ProtoMessageErr interface { ProtoMessage Error() error }
ProtoMessageErr represents a message that was not published successfully to a messaging system.
type ProtoPublisher ¶
type ProtoPublisher interface { datasync.KeyProtoValWriter }
ProtoPublisher allows to publish a message of type proto.Message into messaging system.
type ProtoWatcher ¶
type ProtoWatcher interface { Watch(msgCallback func(ProtoMessage), topics ...string) error StopWatch(topic string) error }
ProtoWatcher allows to subscribe for receiving of messages published to given topics.
type WithLoggerOpt ¶
type WithLoggerOpt struct {
// contains filtered or unexported fields
}
WithLoggerOpt defines a logger that logs if delivery of notification is unsuccessful.
func WithLogger ¶
func WithLogger(logger logging.Logger) *WithLoggerOpt
WithLogger creates an option for ToChan function that specifies a logger to be used.
type WithTimeoutOpt ¶
type WithTimeoutOpt struct {
// contains filtered or unexported fields
}
WithTimeoutOpt defines the maximum time that is attempted to deliver notification.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) *WithTimeoutOpt
WithTimeout creates an option for ToChan function that defines a timeout for notification delivery.
Directories ¶
Path | Synopsis |
---|---|
Package kafka implements a client for the Kafka broker.
|
Package kafka implements a client for the Kafka broker. |
client
Package client implements the synchronous and asynchronous kafka Producers and the kafka Consumer.
|
Package client implements the synchronous and asynchronous kafka Producers and the kafka Consumer. |
mux
Package mux implements the session multiplexer that allows multiple plugins to share a single connection to a Kafka broker.
|
Package mux implements the session multiplexer that allows multiple plugins to share a single connection to a Kafka broker. |