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(_ context.Context) error
- func (b *NatsBroker) History(_ string, _ centrifuge.HistoryFilter) ([]*centrifuge.Publication, centrifuge.StreamPosition, error)
- func (b *NatsBroker) Publish(ch string, data []byte, opts centrifuge.PublishOptions) (centrifuge.StreamPosition, error)
- func (b *NatsBroker) PublishControl(data []byte, nodeID, _ string) error
- func (b *NatsBroker) PublishJoin(ch string, info *centrifuge.ClientInfo) error
- func (b *NatsBroker) PublishLeave(ch string, info *centrifuge.ClientInfo) error
- func (b *NatsBroker) RemoveHistory(_ string) 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 Config ¶
type Config struct { URL string Prefix string DialTimeout time.Duration WriteTimeout time.Duration }
Config of NatsBroker.
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 Broker interface description.
func (*NatsBroker) Close ¶
func (b *NatsBroker) Close(_ context.Context) error
Close is not implemented.
func (*NatsBroker) History ¶
func (b *NatsBroker) History(_ string, _ centrifuge.HistoryFilter) ([]*centrifuge.Publication, centrifuge.StreamPosition, error)
History ...
func (*NatsBroker) Publish ¶
func (b *NatsBroker) Publish(ch string, data []byte, opts centrifuge.PublishOptions) (centrifuge.StreamPosition, error)
Publish - see Broker interface description.
func (*NatsBroker) PublishControl ¶
func (b *NatsBroker) PublishControl(data []byte, nodeID, _ string) error
PublishControl - see Broker interface description.
func (*NatsBroker) PublishJoin ¶
func (b *NatsBroker) PublishJoin(ch string, info *centrifuge.ClientInfo) error
PublishJoin - see Broker interface description.
func (*NatsBroker) PublishLeave ¶
func (b *NatsBroker) PublishLeave(ch string, info *centrifuge.ClientInfo) error
PublishLeave - see Broker interface description.
func (*NatsBroker) RemoveHistory ¶
func (b *NatsBroker) RemoveHistory(_ string) error
RemoveHistory ...
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 Broker interface description.
func (*NatsBroker) Unsubscribe ¶
func (b *NatsBroker) Unsubscribe(ch string) error
Unsubscribe - see Broker interface description.
Click to show internal directories.
Click to hide internal directories.