Documentation
¶
Index ¶
- func ChanExecute(subject string, msgChan chan *nats.Msg, process func(msg *nats.Msg))
- func ChanSubscribe(subj string, ch chan *nats.Msg) (*nats.Subscription, error)
- func Close()
- func Init()
- func Publish(subj string, data []byte) error
- func Request(subj string, data []byte, timeout time.Duration) (*nats.Msg, error)
- func Subscribe(subj string, cb nats.MsgHandler) (*nats.Subscription, error)
- type NatsConnect
- type OptionFunc
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChanExecute ¶ added in v1.1.29
func ChanExecute(subject string, msgChan chan *nats.Msg, process func(msg *nats.Msg))
func ChanSubscribe ¶ added in v1.1.29
Types ¶
type NatsConnect ¶
type NatsConnect struct { *nats.Conn Options }
func App ¶ added in v1.1.29
func App() *NatsConnect
func New ¶ added in v1.1.29
func New(opts ...OptionFunc) *NatsConnect
func (*NatsConnect) Connect ¶
func (p *NatsConnect) Connect()
func (*NatsConnect) GetNatsOption ¶
func (p *NatsConnect) GetNatsOption() []nats.Option
func (*NatsConnect) LoadConfig ¶ added in v1.1.29
func (p *NatsConnect) LoadConfig(config cfacade.JsonConfig)
type OptionFunc ¶
type OptionFunc func(opts *Options)
func WithAddress ¶
func WithAddress(address string) OptionFunc
func WithAuth ¶
func WithAuth(user, password string) OptionFunc
func WithParams ¶
func WithParams(reconnectDelay int, maxReconnects int, requestTimeout time.Duration) OptionFunc
Click to show internal directories.
Click to hide internal directories.