Documentation ¶
Index ¶
- Variables
- type Broker
- func (b *Broker) Close(ctx context.Context) error
- func (b *Broker) Init(ctx context.Context, c config.Config) error
- func (b *Broker) Publish(ctx context.Context, topic string, payload event.Payload) event.Publishing
- func (b *Broker) Run(ctx context.Context) error
- func (b *Broker) Start(ctx context.Context) app.Waiter
- func (b *Broker) Subscribe(ctx context.Context, topic string) event.SubscriptionMsg
- func (b *Broker) SubscribeHandler(ctx context.Context, topic string, handler event.MessageHandler) event.Subscription
- type Config
- type Options
- type OptionsFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOperationCanceled = errors.New("operation canceled") ErrAlreadyClosed = errors.New("subscription already closed") ErrCommandBufferExceeded = errors.New("can't handle anymore command, buffer exceeded") ErrPublishBufferExceeded = errors.New("can't handle anymore publish, buffer exceeded") ErrSubscribeBufferExceeded = errors.New("can't send to the subscriber, buffer exceeded") ErrStopped = errors.New("channel broker stopped") )
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func (*Broker) SubscribeHandler ¶
func (b *Broker) SubscribeHandler(ctx context.Context, topic string, handler event.MessageHandler) event.Subscription
type OptionsFunc ¶
type OptionsFunc func(b *Broker)
func WithConfig ¶
func WithConfig(config Config) OptionsFunc
func WithRunOnInit ¶
func WithRunOnInit(runOnInit bool) OptionsFunc
func (OptionsFunc) Configure ¶
func (f OptionsFunc) Configure(b *Broker)
Click to show internal directories.
Click to hide internal directories.