broker

package
v5.7.9 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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
}

func InitNATSBroker

func InitNATSBroker() *NATSBroker

func (*NATSBroker) Close

func (n *NATSBroker) Close() error

func (*NATSBroker) Connect

func (n *NATSBroker) Connect(url string) error

func (*NATSBroker) IsConnected

func (n *NATSBroker) IsConnected() bool

func (*NATSBroker) Publish

func (n *NATSBroker) Publish(topic string, message []byte) error

func (*NATSBroker) Subscribe

func (n *NATSBroker) Subscribe(topic string, handler func(message []byte)) error

func (*NATSBroker) Unsubscribe

func (n *NATSBroker) Unsubscribe(topic string) error

type PubSubBroker

type PubSubBroker interface {
	Connect(url string) error

	Publish(topic string, message []byte) error
	Subscribe(topic string, handler func(message []byte)) error
	Unsubscribe(topic string) error

	IsConnected() bool
	Close() error
}

type RedisBroker

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

func InitRedisBroker

func InitRedisBroker() *RedisBroker

func (*RedisBroker) Close

func (r *RedisBroker) Close() error

func (*RedisBroker) Connect

func (r *RedisBroker) Connect(url string) error

func (*RedisBroker) IsConnected

func (r *RedisBroker) IsConnected() bool

func (*RedisBroker) Publish

func (r *RedisBroker) Publish(topic string, message []byte) error

func (*RedisBroker) Subscribe

func (r *RedisBroker) Subscribe(topic string, handler func(message []byte)) error

func (*RedisBroker) Unsubscribe

func (r *RedisBroker) Unsubscribe(topic string) error

Jump to

Keyboard shortcuts

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