mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-06 08:16:03 +02:00
3ce2ab88f5
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
20 lines
437 B
Go
20 lines
437 B
Go
package nats
|
|
|
|
import (
|
|
"github.com/micro/go-micro/v2/broker"
|
|
nats "github.com/nats-io/nats.go"
|
|
)
|
|
|
|
type optionsKey struct{}
|
|
type drainConnectionKey struct{}
|
|
|
|
// Options accepts nats.Options
|
|
func Options(opts nats.Options) broker.Option {
|
|
return setBrokerOption(optionsKey{}, opts)
|
|
}
|
|
|
|
// DrainConnection will drain subscription on close
|
|
func DrainConnection() broker.Option {
|
|
return setBrokerOption(drainConnectionKey{}, struct{}{})
|
|
}
|