broker

package
v0.0.0-...-e63497c Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelSubscribe   = "channels.create"
	ChannelUnsubscribe = "channels.delete"
)

Variables

This section is empty.

Functions

func NewNATS

func NewNATS(opts *NATSOptions) service.Broker

Types

type NATS

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

func (*NATS) Bind

func (broker *NATS) Bind(svc *service.Service)

func (*NATS) Connect

func (broker *NATS) Connect() error

func (*NATS) Disconnect

func (broker *NATS) Disconnect() error

func (*NATS) Publish

func (broker *NATS) Publish(endpoint string, data interface{}) error

func (*NATS) Request

func (broker *NATS) Request(endpoint string, data interface{}) (*service.Context, error)

func (*NATS) Subscribe

func (broker *NATS) Subscribe(channel string, channelHandler service.ChannelHandler) error

func (*NATS) Unsubscribe

func (broker *NATS) Unsubscribe(channel string) error

type NATSOptions

type NATSOptions struct {
	URI            string
	NATSOptions    []nats.Option
	RequestTimeout time.Duration
}

Jump to

Keyboard shortcuts

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