mirror of
https://github.com/go-micro/go-micro.git
synced 2025-07-12 22:41:07 +02:00
20 lines
428 B
Go
20 lines
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{}{})
|
|
}
|