Skip to content
Snippets Groups Projects
Commit a1ff189f authored by Patrick's avatar Patrick
Browse files

fix rest

parent e9fc1f85
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,6 @@
package reader_impl
import (
"github.com/apache/dubbo-go/config/rest"
"github.com/apache/dubbo-go/config/rest/config_reader"
"os"
)
......@@ -31,6 +29,8 @@ import (
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/yaml"
"github.com/apache/dubbo-go/config/rest"
"github.com/apache/dubbo-go/config/rest/config_reader"
)
var (
......
......@@ -37,14 +37,14 @@ import (
)
func init() {
extension.SetRestClient(constant.DEFAULT_REST_CLIENT, GetRestyClient)
extension.SetRestClient(constant.DEFAULT_REST_CLIENT, NewRestyClient)
}
type RestyClient struct {
client *resty.Client
}
func NewRestyClient(restOption *client.RestOptions) *RestyClient {
func NewRestyClient(restOption *client.RestOptions) client.RestClient {
client := resty.New()
client.SetTransport(
&http.Transport{
......@@ -83,7 +83,3 @@ func (rc *RestyClient) Do(restRequest *client.RestRequest, res interface{}) erro
}
return nil
}
func GetRestyClient(restOptions *client.RestOptions) client.RestClient {
return NewRestyClient(restOptions)
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment