pkg

package
v0.0.0-...-251cc68 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncSub

func AsyncSub(nc *NatsConn, subj string, msgHandler nats.MsgHandler) (*nats.Subscription, error)

Sub subscribe to the connection based on the provided subject. nc can be nil. msgHandler is a callback function that processes messages delivered to asynchronous subscribers.

func DisplayMsg

func DisplayMsg(msg *nats.Msg)

Types

type NatsConn

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

NatsConn represents the nats connection.

func NewConn

func NewConn(url string) (*NatsConn, error)

NewConn create a nats connection. url can be empty string.

type PubObject

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

PubObject represents the nats object to be sent.

func NewPubObj

func NewPubObj(subj string, data []byte) *PubObject

NewPubObj create a PubObject.

func (*PubObject) Pub

func (po *PubObject) Pub(nc *NatsConn) error

Pub publish objects on the supplied connection. nc can be nil.

Jump to

Keyboard shortcuts

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