Support secure nats option
This commit is contained in:
parent
dd4a69b4a2
commit
bf60028cf1
5
nats.go
5
nats.go
@ -67,6 +67,8 @@ func (n *nbroker) Connect() error {
|
||||
|
||||
opts := nats.DefaultOptions
|
||||
opts.Servers = n.addrs
|
||||
opts.Secure = n.opts.Secure
|
||||
|
||||
c, err := opts.Connect()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -81,6 +83,9 @@ func (n *nbroker) Disconnect() error {
|
||||
}
|
||||
|
||||
func (n *nbroker) Init(opts ...broker.Option) error {
|
||||
for _, o := range opts {
|
||||
o(&n.opts)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user