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
|
||||
}
|
||||
|
||||
func NewOptions() Options {
|
||||
return Options{
|
||||
func NewOptions(opts ...Option) Options {
|
||||
options := Options{
|
||||
Auth: auth.DefaultAuth,
|
||||
Codecs: make(map[string]codec.NewCodec),
|
||||
Context: context.Background(),
|
||||
@ -66,7 +66,14 @@ func NewOptions() Options {
|
||||
Name: DefaultName,
|
||||
Version: DefaultVersion,
|
||||
Id: DefaultId,
|
||||
Transport: transport.DefaultTransport,
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
// Server name
|
||||
|
Loading…
x
Reference in New Issue
Block a user