nats

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Infinity    = math.MaxInt32
	MinAttempts = 4
)

Variables

This section is empty.

Functions

func CloseDefaultClient

func CloseDefaultClient()

func IsInitialized

func IsInitialized() bool

Types

type DurableSub

type DurableSub struct {
	stan.Subscription
	// contains filtered or unexported fields
}

type NatsClient

type NatsClient struct {
	stan.Conn
	Addr string
	// contains filtered or unexported fields
}

func GetDefaultClient

func GetDefaultClient() *NatsClient

func InitDefaultClient

func InitDefaultClient(natsConfig *NatsConfig) (nc *NatsClient)

func NewNatsStreamingServerClient

func NewNatsStreamingServerClient(natsConfig *NatsConfig) (*NatsClient, error)

func (*NatsClient) Close

func (nc *NatsClient) Close() error

func (*NatsClient) MakeDurableQueueSubscription

func (nc *NatsClient) MakeDurableQueueSubscription(subject string, handler stan.MsgHandler) (stan.Subscription, error)

type NatsConfig

type NatsConfig struct {
	ClusterId             string                         `valid:"required~Required" schema:"Cluster ID"`
	Address               structure.AddressConfiguration `valid:"required~Required" schema:"Address"`
	PingAttempts          int                            `schema:"Max ping attempts,When max attempts is reached connection is closed"`
	PintIntervalSec       int                            `schema:"Ping interval,In seconds"`
	ClientId              string                         `json:"-"`
	ConnectionLostHandler nats.ConnHandler               `json:"-"`
}

Jump to

Keyboard shortcuts

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