provide compa options

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-02-02 15:37:12 +03:00
parent 2cb6843773
commit a0bbfd6d02

View File

@ -134,6 +134,14 @@ func BrokerServer(n string) BrokerOption {
} }
} }
// Client to be used for service
func Client(c ...client.Client) Option {
return func(o *Options) error {
o.Clients = c
return nil
}
}
// Clients to be used for service // Clients to be used for service
func Clients(c ...client.Client) Option { func Clients(c ...client.Client) Option {
return func(o *Options) error { return func(o *Options) error {
@ -161,6 +169,14 @@ func Profile(p profile.Profile) Option {
} }
*/ */
// Server to be used for service
func Server(s ...server.Server) Option {
return func(o *Options) error {
o.Servers = s
return nil
}
}
// Servers to be used for service // Servers to be used for service
func Servers(s ...server.Server) Option { func Servers(s ...server.Server) Option {
return func(o *Options) error { return func(o *Options) error {
@ -169,6 +185,14 @@ func Servers(s ...server.Server) Option {
} }
} }
// Store sets the store to use
func Store(s ...store.Store) Option {
return func(o *Options) error {
o.Stores = s
return nil
}
}
// Stores sets the store to use // Stores sets the store to use
func Stores(s ...store.Store) Option { func Stores(s ...store.Store) Option {
return func(o *Options) error { return func(o *Options) error {
@ -275,6 +299,14 @@ func LoggerServer(n string) LoggerOption {
} }
*/ */
// Meter set the meter to use
func Meter(m ...meter.Meter) Option {
return func(o *Options) error {
o.Meters = m
return nil
}
}
// Meters set the meter to use // Meters set the meter to use
func Meters(m ...meter.Meter) Option { func Meters(m ...meter.Meter) Option {
return func(o *Options) error { return func(o *Options) error {
@ -450,6 +482,14 @@ func Auth(a auth.Auth) Option {
} }
*/ */
// Config sets the config for the service
func Config(c ...config.Config) Option {
return func(o *Options) error {
o.Configs = c
return nil
}
}
// Configs sets the configs for the service // Configs sets the configs for the service
func Configs(c ...config.Config) Option { func Configs(c ...config.Config) Option {
return func(o *Options) error { return func(o *Options) error {