cherryNats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInstance

func SetInstance(conn *Conn)

Types

type Conn

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

func Get

func Get() *Conn

func New

func New(opts ...OptionFunc) *Conn

func NewFromConfig

func NewFromConfig(config cfacade.ProfileJSON) *Conn

func (*Conn) Address

func (p *Conn) Address() string

func (*Conn) ChanExecute

func (p *Conn) ChanExecute(subject string, msgChan chan *nats.Msg, process func(msg *nats.Msg))

func (*Conn) Close

func (p *Conn) Close()

func (*Conn) Connect

func (p *Conn) Connect()

func (*Conn) MaxReconnects

func (p *Conn) MaxReconnects() int

func (*Conn) ReconnectDelay

func (p *Conn) ReconnectDelay() time.Duration

func (*Conn) Request

func (p *Conn) Request(subj string, data []byte, timeout ...time.Duration) (*nats.Msg, error)

func (*Conn) RequestTimeout

func (p *Conn) RequestTimeout() time.Duration

type OptionFunc

type OptionFunc func(o *options)

func WithAddress

func WithAddress(address string) OptionFunc

func WithAuth

func WithAuth(user, password string) OptionFunc

func WithParams

func WithParams(maxReconnects int, reconnectDelay int, requestTimeout int) OptionFunc

Jump to

Keyboard shortcuts

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