cherryNats

package
v1.4.19 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	REQ_ID = "reqID"
)

Variables

This section is empty.

Functions

func ConnectClose added in v1.4.4

func ConnectClose()

func GetMsg added in v1.4.4

func GetMsg() *nats.Msg

func GetTimeout added in v1.4.4

func GetTimeout(tod ...time.Duration) time.Duration

func NewPool added in v1.4.4

func NewPool(replySubject string, config cfacade.ProfileJSON, isConnect bool)

func ReconnectDelay added in v1.4.4

func ReconnectDelay() time.Duration

func ReleaseMsg added in v1.4.4

func ReleaseMsg(msg *nats.Msg)

Types

type Connect added in v1.4.4

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

func GetConnect added in v1.4.4

func GetConnect() *Connect

func GetPool added in v1.4.4

func GetPool() []*Connect

func NewConnect added in v1.4.4

func NewConnect(id int, replySubject string, opts ...OptionFunc) *Connect

func (*Connect) Address added in v1.4.4

func (p *Connect) Address() string

func (*Connect) Close added in v1.4.4

func (p *Connect) Close()

func (*Connect) Connect added in v1.4.4

func (p *Connect) Connect()

func (*Connect) GetID added in v1.4.4

func (p *Connect) GetID() int

func (*Connect) MaxReconnects added in v1.4.4

func (p *Connect) MaxReconnects() int

func (*Connect) QueueSubscribe added in v1.4.4

func (p *Connect) QueueSubscribe(subject, queue string, cb nats.MsgHandler) error

func (*Connect) Request added in v1.4.4

func (p *Connect) Request(subject string, data []byte, tod ...time.Duration) ([]byte, error)

func (*Connect) RequestSync added in v1.4.4

func (p *Connect) RequestSync(subject string, data []byte, tod ...time.Duration) ([]byte, error)

func (*Connect) Subs added in v1.4.8

func (p *Connect) Subs() []*nats.Subscription

func (*Connect) Subscribe added in v1.4.8

func (p *Connect) Subscribe(subject string, cb nats.MsgHandler) error

type OptionFunc

type OptionFunc func(o *options)

func WithAddress

func WithAddress(address string) OptionFunc

func WithAuth

func WithAuth(user, password string) OptionFunc

func WithIsStats added in v1.4.4

func WithIsStats(isStats bool) OptionFunc

func WithParams

func WithParams(maxReconnects int) OptionFunc

Jump to

Keyboard shortcuts

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