nsq

package
v0.0.0-...-0387419 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 5 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
}

Broker is an implementation of the broker interface which handles orchestrating NSQ.

func (*Broker) Start

func (n *Broker) Start(host, port string) (interface{}, error)

Start will start the message broker and prepare it for testing.

func (*Broker) Stop

func (n *Broker) Stop() (interface{}, error)

Stop will stop the message broker.

type Peer

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

Peer implements the peer interface for NSQ.

func NewPeer

func NewPeer(host string) (*Peer, error)

NewPeer creates and returns a new Peer for communicating with NSQ.

func (*Peer) Done

func (n *Peer) Done()

Done signals to the peer that message publishing has completed.

func (*Peer) Errors

func (n *Peer) Errors() <-chan error

Errors returns the channel on which the peer sends publish errors.

func (*Peer) Recv

func (n *Peer) Recv() ([]byte, error)

Recv returns a single message consumed by the peer. Subscribe must be called before this. It returns an error if the receive failed.

func (*Peer) Send

func (n *Peer) Send() chan<- []byte

Send returns a channel on which messages can be sent for publishing.

func (*Peer) Setup

func (n *Peer) Setup()

Setup prepares the peer for testing.

func (*Peer) Subscribe

func (n *Peer) Subscribe() error

Subscribe prepares the peer to consume messages.

func (*Peer) Teardown

func (n *Peer) Teardown()

Teardown performs any cleanup logic that needs to be performed after the test is complete.

Jump to

Keyboard shortcuts

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