more useful router new options func
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
74c10f1139
commit
5787a1afb8
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user