Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NATSConnectParams ¶
type NATSConnectParams struct { // connect to NATS JetStream cluster with this URI ServerURI string `validate:"required,uri"` // max time to wait for connection in ns ConnectTimeout time.Duration // on connection failure, max number of reconnect attempt. "-1" means infinite MaxReconnectAttempt int `validate:"gte=-1"` // wait duration between reconnect attempts ReconnectWait time.Duration // callback on client disconnect OnDisconnectCallback func(*nats.Conn, error) // callback on client reconnect OnReconnectCallback func(*nats.Conn) // callback on client connection closed OnCloseCallback func(*nats.Conn) }
NATSConnectParams contains NATS connection parameters
type NatsClient ¶
NatsClient is a wrapper around NATS client handle objects
func GetJetStream ¶
func GetJetStream(param NATSConnectParams) (*NatsClient, error)
GetJetStream defines a new NATS client object wrapper
NOTE: Function will also attempt to connect with NATs server
func (*NatsClient) Close ¶
func (js *NatsClient) Close(ctxt context.Context)
Close closes a JetStream client
func (*NatsClient) JetStream ¶
func (js *NatsClient) JetStream() nats.JetStreamContext
JetStream fetches the JetStream client handle
func (*NatsClient) NATs ¶
func (js *NatsClient) NATs() *nats.Conn
NATs fetches the NATs client handle
Click to show internal directories.
Click to hide internal directories.