broker

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

func (*Broker) Close

func (b *Broker) Close() error

func (*Broker) Consume

func (b *Broker) Consume(queue, exchange, exchangeKing string, handler func(packet brokerPacket.IPacket))

func (*Broker) IsAvailable

func (b *Broker) IsAvailable() bool

func (*Broker) Publish

func (b *Broker) Publish(queue, exchange, exchangeKind string, body []byte) error

type IBroker

type IBroker interface {
	IsAvailable() bool
	Consume(queue, exchange, exchangeKind string, handler func(packet brokerPacket.IPacket))
	Publish(queue, exchange, exchangeKind string, body []byte) error
	Close() error
}

func NewBroker

func NewBroker(config brokerConfig.IConfig) (IBroker, error)

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) Close

func (m *Mock) Close() error

func (*Mock) Consume

func (m *Mock) Consume(queue, exchange, exchangeKind string, handler func(packet brokerPacket.IPacket))

func (*Mock) IsAvailable

func (m *Mock) IsAvailable() bool

func (*Mock) Publish

func (m *Mock) Publish(queue, exchange, exchangeKind string, body []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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