micro/broker/nats/options.go

20 lines
434 B
Go
Raw Normal View History

2019-05-29 16:46:57 +01:00
package nats
import (
"github.com/micro/go-micro/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{}{})
2019-05-29 16:46:57 +01:00
}