Documentation ¶
Index ¶
- type Client
- func (c *Client) Connect() (err error)
- func (c *Client) Disconnect() error
- func (c *Client) IsConnected() bool
- func (c *Client) Publish(subject string, data string) error
- func (c *Client) PublishRaw(subject string, data []byte) error
- func (c *Client) Subscribe(subject string, cb SubscribeCallback, opts ...SubscribeOption) error
- func (c *Client) Unsubscribe(subject string) error
- func (c *Client) WithAck() SubscribeOption
- func (c *Client) WithCache() SubscribeOption
- type Option
- type SubjectMessage
- type SubscribeCallback
- type SubscribeOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { JS nats.JetStreamContext // contains filtered or unexported fields }
WebSocketClient return websocket client connection
func (*Client) Disconnect ¶
Close will unsubscribe all subjects and shutdown connection
func (*Client) IsConnected ¶
func (*Client) Subscribe ¶
func (c *Client) Subscribe(subject string, cb SubscribeCallback, opts ...SubscribeOption) error
func (*Client) Unsubscribe ¶
func (*Client) WithAck ¶
func (c *Client) WithAck() SubscribeOption
func (*Client) WithCache ¶
func (c *Client) WithCache() SubscribeOption
type SubjectMessage ¶
type SubscribeCallback ¶
type SubscribeCallback func(msg *SubjectMessage)
type SubscribeOption ¶
type SubscribeOption func(subject string, cb SubscribeCallback) error
Click to show internal directories.
Click to hide internal directories.