natsx

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package natsx implements connections to NATS and NATS Streaming (STAN).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NATSConn

type NATSConn struct {
	*nats.Conn
	// contains filtered or unexported fields
}

NATSConn adds connection monitoring to nats.Conn.

func ConnectNATS

func ConnectNATS(ctx context.Context, urls, name string) (*NATSConn, error)

ConnectNATS adds ctx support and reasonable defaults to nats.Connect.

func (*NATSConn) Monitor

func (c *NATSConn) Monitor(ctx context.Context) error

Monitor waits until ctx.Done or failure reconnecting NATS.

type STANConn

type STANConn struct {
	stan.Conn
	// contains filtered or unexported fields
}

STANConn adds connection monitoring to stan.Conn.

func ConnectSTAN

func ConnectSTAN(ctx context.Context, clusterID, clientID string, nc *NATSConn) (*STANConn, error)

ConnectSTAN adds ctx support and reasonable defaults to stan.Connect.

func (*STANConn) Monitor

func (c *STANConn) Monitor(ctx context.Context) error

Monitor waits until ctx.Done or closed STAN connection.

Jump to

Keyboard shortcuts

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