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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.