natsbroker

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package natsbroker defines custom Nats Broker for Centrifuge library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers string
	Prefix  string
}

Config of NatsEngine.

type NatsBroker

type NatsBroker struct {
	// contains filtered or unexported fields
}

NatsBroker is a broker on top of Nats messaging system.

func New

func New(n *centrifuge.Node, conf Config) (*NatsBroker, error)

New creates NatsEngine.

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL