config package rework (#9)

* change config interface
* reuse codec
* allow to modify next config based on values in current config via BeforeLoad

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-04 02:28:45 +03:00
committed by GitHub
parent 0ddc8de00b
commit 5279c2aa0f
28 changed files with 294 additions and 1190 deletions

View File

@@ -2,6 +2,7 @@ package client
import (
"context"
"fmt"
"sort"
"github.com/unistack-org/micro/v3/errors"
@@ -18,6 +19,10 @@ func LookupRoute(ctx context.Context, req Request, opts CallOptions) ([]string,
return opts.Address, nil
}
if opts.Router == nil {
return nil, router.ErrRouteNotFound
}
// construct the router query
query := []router.QueryOption{router.QueryService(req.Service())}