nats

package
v0.0.0-...-be0919c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnectionFake

func NewConnectionFake() *connectionFake

NewConnectionFake constructs new NATS connection which delivers published messages to local subscribers

func NewReceiver

func NewReceiver(connection Connection, codec communication.Codec, topic string) *receiverNATS

NewReceiver constructs new Receiver's instance which works thru NATS connection. Codec packs/unpacks messages to byte payloads. Topic (optional) if need to send messages prefixed topic.

func NewSender

func NewSender(connection Connection, codec communication.Codec, topic string) *senderNATS

NewSender constructs new Sender's instance which works thru NATS connection. Codec packs/unpacks messages to byte payloads. Topic (optional) if need to send messages prefixed topic.

func StartConnectionFake

func StartConnectionFake() *connectionFake

StartConnectionFake creates connection and starts it immediately

Types

type Connection

type Connection interface {
	Publish(subject string, payload []byte) error
	Subscribe(subject string, handler nats.MsgHandler) (*nats.Subscription, error)
	Request(subject string, payload []byte, timeout time.Duration) (*nats.Msg, error)
	Close()
}

Connection represents is publish-subscriber instance which can deliver messages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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