fixup opts
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
8f03480ed2
commit
9ea3149b60
@ -51,8 +51,8 @@ type Options struct {
|
|||||||
Context context.Context
|
Context context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOptions() Options {
|
func NewOptions(opts ...Option) Options {
|
||||||
return Options{
|
options := Options{
|
||||||
Auth: auth.DefaultAuth,
|
Auth: auth.DefaultAuth,
|
||||||
Codecs: make(map[string]codec.NewCodec),
|
Codecs: make(map[string]codec.NewCodec),
|
||||||
Context: context.Background(),
|
Context: context.Background(),
|
||||||
@ -66,7 +66,14 @@ func NewOptions() Options {
|
|||||||
Name: DefaultName,
|
Name: DefaultName,
|
||||||
Version: DefaultVersion,
|
Version: DefaultVersion,
|
||||||
Id: DefaultId,
|
Id: DefaultId,
|
||||||
|
Transport: transport.DefaultTransport,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, o := range opts {
|
||||||
|
o(&options)
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server name
|
// Server name
|
||||||
|
Loading…
Reference in New Issue
Block a user