Documentation
¶
Index ¶
- Constants
- func GetNatsMsg() *nats.Msg
- func NewReqID() uint64
- func NewStringReqID() string
- func PoolClose()
- func Publish(subject string, data []byte) error
- func PublishMsg(msg *nats.Msg) error
- func ReleaseNatsMsg(natsMsg *nats.Msg)
- func ReplySync(reqID, reply string, data []byte) error
- func Request(subject string, data []byte, timeout ...time.Duration) ([]byte, error)
- func RequestSync(reqID, subject string, data []byte, timeout ...time.Duration) ([]byte, error)
- func Subscribe(subject string, cb nats.MsgHandler) error
- type Connect
- func (p *Connect) Address() string
- func (p *Connect) Close()
- func (p *Connect) Connect()
- func (p *Connect) GetID() int
- func (p *Connect) MaxReconnects() int
- func (p *Connect) QueueSubscribe(subject, queue string, cb nats.MsgHandler) error
- func (p *Connect) ReconnectDelay() time.Duration
- func (p *Connect) ReplySync(reqID, reply string, data []byte) error
- func (p *Connect) Request(subject string, data []byte, tod ...time.Duration) ([]byte, error)
- func (p *Connect) RequestSync(reqID, subject string, data []byte, tod ...time.Duration) ([]byte, error)
- func (p *Connect) RequestTimeout() time.Duration
- func (p *Connect) StatsInterval() time.Duration
- func (p *Connect) Subscribe(subject string, cb nats.MsgHandler) error
- func (p *Connect) Timeout(tod ...time.Duration) time.Duration
- type ConnectPool
- type OptionFunc
- func WithAddress(address string) OptionFunc
- func WithAuth(user, password string) OptionFunc
- func WithIsStats(isStats bool) OptionFunc
- func WithParams(maxReconnects int) OptionFunc
- func WithReconnectDelay(delay time.Duration) OptionFunc
- func WithRequestTimeout(timeout time.Duration) OptionFunc
- func WithStatsInterval(seconds int) OptionFunc
Constants ¶
View Source
const (
REQ_ID = "reqID"
)
Variables ¶
This section is empty.
Functions ¶
func GetNatsMsg ¶ added in v1.4.22
func NewStringReqID ¶ added in v1.4.22
func NewStringReqID() string
func PublishMsg ¶ added in v1.4.22
func ReleaseNatsMsg ¶ added in v1.4.22
func RequestSync ¶ added in v1.4.22
Types ¶
type Connect ¶ added in v1.4.4
func NewConnect ¶ added in v1.4.4
func NewConnect(id int, replySubject string, opts ...OptionFunc) *Connect
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) ReconnectDelay ¶ added in v1.4.22
func (*Connect) RequestSync ¶ added in v1.4.4
func (*Connect) RequestTimeout ¶ added in v1.4.22
func (*Connect) StatsInterval ¶ added in v1.4.22
type ConnectPool ¶ added in v1.4.22
type ConnectPool struct {
// contains filtered or unexported fields
}
func InitPool ¶ added in v1.4.22
func InitPool(replySubject string, config cfacade.ProfileJSON, isConnect bool) *ConnectPool
func NewConnectPool ¶ added in v1.4.22
func NewConnectPool(replySubject string, config cfacade.ProfileJSON, isConnect bool) *ConnectPool
func Pool ¶ added in v1.4.22
func Pool() *ConnectPool
func (*ConnectPool) GetConnect ¶ added in v1.4.22
func (p *ConnectPool) GetConnect() *Connect
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
func WithReconnectDelay ¶ added in v1.4.22
func WithReconnectDelay(delay time.Duration) OptionFunc
func WithRequestTimeout ¶ added in v1.4.22
func WithRequestTimeout(timeout time.Duration) OptionFunc
func WithStatsInterval ¶ added in v1.4.22
func WithStatsInterval(seconds int) OptionFunc
Click to show internal directories.
Click to hide internal directories.