micro-broker-nats/options.go
Vasiliy Tolstov 57dc17d58c use own fork
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-29 18:20:06 +03:00

20 lines
443 B
Go

package nats
import (
nats "github.com/nats-io/nats.go"
"github.com/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{}{})
}