micro--go-micro
cd2b40ca4a
* WIP * fix: default memory registry, add registrations for mdns, nats * fix: same for broker * fix: add more * fix: http port * rename redis * chore: linting
20 行
428 B
Go
20 行
428 B
Go
package nats
|
|
|
|
import (
|
|
natsp "github.com/nats-io/nats.go"
|
|
"go-micro.dev/v5/broker"
|
|
)
|
|
|
|
type optionsKey struct{}
|
|
type drainConnectionKey struct{}
|
|
|
|
// Options accepts nats.Options.
|
|
func Options(opts natsp.Options) broker.Option {
|
|
return setBrokerOption(optionsKey{}, opts)
|
|
}
|
|
|
|
// DrainConnection will drain subscription on close.
|
|
func DrainConnection() broker.Option {
|
|
return setBrokerOption(drainConnectionKey{}, struct{}{})
|
|
}
|