support direct scheme on rpc resolver

This commit is contained in:
kevin
2020-08-18 18:36:44 +08:00
parent 0214161bfc
commit f03cfb0ff7
11 changed files with 170 additions and 134 deletions

View File

@@ -21,19 +21,19 @@ type (
}
RpcClientConf struct {
Etcd discov.EtcdConf `json:",optional"`
Server string `json:",optional=!Etcd"`
App string `json:",optional"`
Token string `json:",optional"`
Timeout int64 `json:",optional"`
Etcd discov.EtcdConf `json:",optional"`
Endpoints []string `json:",optional=!Etcd"`
App string `json:",optional"`
Token string `json:",optional"`
Timeout int64 `json:",optional"`
}
)
func NewDirectClientConf(server, app, token string) RpcClientConf {
func NewDirectClientConf(endpoints []string, app, token string) RpcClientConf {
return RpcClientConf{
Server: server,
App: app,
Token: token,
Endpoints: endpoints,
App: app,
Token: token,
}
}