more useful router new options func

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-09-17 15:44:35 +03:00
parent 74c10f1139
commit 5787a1afb8

View File

@ -77,11 +77,17 @@ func Precache() Option {
} }
} }
// DefaultOptions returns router default options // NewOptions returns router default options
func DefaultOptions() Options { func NewOptions(opts ...Option) Options {
return Options{ options := Options{
Id: uuid.New().String(), Id: uuid.New().String(),
Network: DefaultNetwork, Network: DefaultNetwork,
Registry: registry.DefaultRegistry,
Logger: logger.DefaultLogger,
Context: context.Background(), Context: context.Background(),
} }
for _, o := range opts {
o(&options)
}
return options
} }