Documentation ¶
Overview ¶
Package natsbroker defines custom Nats Broker for Centrifuge library.
Index ¶
- type Config
- type NatsBroker
- func (b *NatsBroker) Channels() ([]string, error)
- func (b *NatsBroker) Close(ctx context.Context) error
- func (b *NatsBroker) Publish(ch string, pub *centrifuge.Publication, opts *centrifuge.ChannelOptions) error
- func (b *NatsBroker) PublishControl(data []byte) error
- func (b *NatsBroker) PublishJoin(ch string, join *centrifuge.Join, opts *centrifuge.ChannelOptions) error
- func (b *NatsBroker) PublishLeave(ch string, leave *centrifuge.Leave, opts *centrifuge.ChannelOptions) error
- func (b *NatsBroker) Run(h centrifuge.BrokerEventHandler) error
- func (b *NatsBroker) Subscribe(ch string) error
- func (b *NatsBroker) Unsubscribe(ch string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NatsBroker ¶
type NatsBroker struct {
// contains filtered or unexported fields
}
NatsBroker is a broker on top of Nats messaging system.
func (*NatsBroker) Channels ¶
func (b *NatsBroker) Channels() ([]string, error)
Channels - see Engine interface description.
func (*NatsBroker) Close ¶
func (b *NatsBroker) Close(ctx context.Context) error
Close is not implemented.
func (*NatsBroker) Publish ¶
func (b *NatsBroker) Publish(ch string, pub *centrifuge.Publication, opts *centrifuge.ChannelOptions) error
Publish - see Engine interface description.
func (*NatsBroker) PublishControl ¶
func (b *NatsBroker) PublishControl(data []byte) error
PublishControl - see Engine interface description.
func (*NatsBroker) PublishJoin ¶
func (b *NatsBroker) PublishJoin(ch string, join *centrifuge.Join, opts *centrifuge.ChannelOptions) error
PublishJoin - see Engine interface description.
func (*NatsBroker) PublishLeave ¶
func (b *NatsBroker) PublishLeave(ch string, leave *centrifuge.Leave, opts *centrifuge.ChannelOptions) error
PublishLeave - see Engine interface description.
func (*NatsBroker) Run ¶
func (b *NatsBroker) Run(h centrifuge.BrokerEventHandler) error
Run runs engine after node initialized.
func (*NatsBroker) Subscribe ¶
func (b *NatsBroker) Subscribe(ch string) error
Subscribe - see Engine interface description.
func (*NatsBroker) Unsubscribe ¶
func (b *NatsBroker) Unsubscribe(ch string) error
Unsubscribe - see Engine interface description.
Click to show internal directories.
Click to hide internal directories.