Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultPublishTimeout = 5 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventDispatcher ¶
type EventDispatcher interface { Publish(topic string, data []byte) error Subscribe(cName string, topic string, handler MsgHandler) error }
func NewInMemoryBus ¶
func NewInMemoryBus() EventDispatcher
type InMemoryEventDispatcher ¶
type InMemoryEventDispatcher struct{}
func (*InMemoryEventDispatcher) Publish ¶
func (d *InMemoryEventDispatcher) Publish(topic string, data []byte) error
func (*InMemoryEventDispatcher) Subscribe ¶
func (d *InMemoryEventDispatcher) Subscribe(cName string, topic string, handler MsgHandler) error
type MsgHandler ¶
type NatsDispatcher ¶
type NatsDispatcher struct {
// contains filtered or unexported fields
}
func NewNatsDispatcher ¶
func NewNatsDispatcher(opts ...NatsDispatcherOptsFunc) *NatsDispatcher
func (*NatsDispatcher) Subscribe ¶
func (nd *NatsDispatcher) Subscribe(cName string, topic string, handler MsgHandler) error
type NatsDispatcherOpts ¶
type NatsDispatcherOpts struct {
// contains filtered or unexported fields
}
type NatsDispatcherOptsFunc ¶
type NatsDispatcherOptsFunc func(*NatsDispatcherOpts)
func WithBucket ¶
func WithBucket(b string) NatsDispatcherOptsFunc
func WithStreamConfig ¶
func WithStreamConfig(c jetstream.StreamConfig) NatsDispatcherOptsFunc
func WithToken ¶
func WithToken(b string) NatsDispatcherOptsFunc
func WithUrl ¶
func WithUrl(u string) NatsDispatcherOptsFunc
type RabbitMQDispatcher ¶
type RabbitMQDispatcher struct {
// contains filtered or unexported fields
}
func NewRabbitMQDispatcher ¶
func NewRabbitMQDispatcher(server string, exchange string) *RabbitMQDispatcher
func (*RabbitMQDispatcher) Close ¶
func (rd *RabbitMQDispatcher) Close()
func (*RabbitMQDispatcher) Publish ¶
func (rd *RabbitMQDispatcher) Publish(topic string, data []byte) error
func (*RabbitMQDispatcher) Subscribe ¶
func (rd *RabbitMQDispatcher) Subscribe(cName string, topic string, handler MsgHandler) error
Click to show internal directories.
Click to hide internal directories.