natsbroker

package
v0.0.0-...-c5fffda Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 8 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 NatsBroker.

func (*NatsBroker) Close

func (b *NatsBroker) Close(_ context.Context) error

Close is not implemented.

func (*NatsBroker) History

History ...

func (*NatsBroker) Publish

Publish - see centrifuge.Broker interface description.

func (*NatsBroker) PublishControl

func (b *NatsBroker) PublishControl(data []byte, nodeID, _ string) error

PublishControl - see centrifuge.Broker interface description.

func (*NatsBroker) PublishJoin

func (b *NatsBroker) PublishJoin(ch string, info *centrifuge.ClientInfo) error

PublishJoin - see centrifuge.Broker interface description.

func (*NatsBroker) PublishLeave

func (b *NatsBroker) PublishLeave(ch string, info *centrifuge.ClientInfo) error

PublishLeave - see centrifuge.Broker interface description.

func (*NatsBroker) RemoveHistory

func (b *NatsBroker) RemoveHistory(_ string) error

RemoveHistory ...

func (*NatsBroker) Run

Run runs broker after node initialized.

func (*NatsBroker) Subscribe

func (b *NatsBroker) Subscribe(ch string) error

Subscribe - see centrifuge.Broker interface description.

func (*NatsBroker) Unsubscribe

func (b *NatsBroker) Unsubscribe(ch string) error

Unsubscribe - see centrifuge.Broker interface description.

Jump to

Keyboard shortcuts

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