broker/nats: remove embed nats server reference (#1527)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-04-11 22:37:29 +03:00
committed by GitHub
parent 0a2363b49b
commit 3ce2ab88f5
3 changed files with 19 additions and 211 deletions

View File

@@ -7,18 +7,12 @@ import (
type optionsKey struct{}
type drainConnectionKey struct{}
type localServerKey struct{}
// Options accepts nats.Options
func Options(opts nats.Options) broker.Option {
return setBrokerOption(optionsKey{}, opts)
}
// LocalServer embeds a local server rather than connecting to one
func LocalServer() broker.Option {
return setBrokerOption(localServerKey{}, true)
}
// DrainConnection will drain subscription on close
func DrainConnection() broker.Option {
return setBrokerOption(drainConnectionKey{}, struct{}{})