micro-broker-nats/options.go
Vasiliy Tolstov a5167a9a96 update import paths
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-10-27 23:01:59 +03:00

20 lines
435 B
Go

package nats
import (
nats "github.com/nats-io/nats.go"
"go.unistack.org/micro/v3/broker"
)
type optionsKey struct{}
type drainConnectionKey struct{}
// Options accepts nats.Options
func Options(opts nats.Options) broker.Option {
return broker.SetOption(optionsKey{}, opts)
}
// DrainConnection will drain subscription on close
func DrainConnection() broker.Option {
return broker.SetOption(drainConnectionKey{}, struct{}{})
}