Documentation ¶
Index ¶
- type Conn
- func (c *Conn) Disconnect(ctx context.Context) error
- func (c *Conn) Flush() error
- func (c *Conn) Publish(ctx context.Context, topic string, data []byte) error
- func (c *Conn) QueueSubscribe(ctx context.Context, sub, group string, cb func(msg *Msg)) error
- func (c *Conn) Request(ctx context.Context, sub string, data []byte, timeout time.Duration) (*Msg, error)
- func (c *Conn) Subscribe(ctx context.Context, topic string, cb func(msg *Msg)) error
- type Msg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn nats.Conn
A Conn represents a bare connection to a nats-server. It can send and receive []byte payloads. It is a type definition of nats.Conn
func NewNatClient ¶
NewNatClient creates a NATS client that connect to given url
func (*Conn) Disconnect ¶
Disconnect drains and closes the connection
func (*Conn) QueueSubscribe ¶
QueueSubscribe to a topic, given callback function
Click to show internal directories.
Click to hide internal directories.