xavier-niu commented on a change in pull request #229:
URL: https://github.com/apache/dubbo-go-samples/pull/229#discussion_r704035363



##########
File path: context/dubbo/go-client/cmd/client.go
##########
@@ -20,50 +20,53 @@ package main
 import (
        "context"
        "os"
-       "time"
 )
 
 import (
-       _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
-       _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
        "dubbo.apache.org/dubbo-go/v3/common/constant"
-       _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
        "dubbo.apache.org/dubbo-go/v3/config"
-       _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
-       _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
-       _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
-       _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
        hessian "github.com/apache/dubbo-go-hessian2"
-
        "github.com/dubbogo/gost/log"
 )
 
-import (
-       pkg2 "github.com/apache/dubbo-go-samples/context/dubbo/go-client/pkg"
-)
+type UserProvider struct {
+       GetContext func(ctx context.Context, req *ContextContent) (rsp 
*ContextContent, err error)
+}
+
+func (u *UserProvider) Reference() string {
+       return "userProvider"
+}
 
-var userProvider = new(pkg2.UserProvider)
+type ContextContent struct {
+       Path              string
+       InterfaceName     string
+       DubboVersion      string
+       LocalAddr         string
+       RemoteAddr        string
+       UserDefinedStrVal string
+       CtxStrVal         string
+       CtxIntVal         int64
+}
 
-func init() {
-       config.SetConsumerService(userProvider)
-       hessian.RegisterPOJO(&pkg2.ContextContent{})
+func (*ContextContent) JavaClassName() string {
+       return "org.apache.dubbo.User"
 }
 
 // need to setup environment variable "CONF_CONSUMER_FILE_PATH" to 
"conf/client.yml" before run

Review comment:
       Please update comments for how to set up environment variable for the 
new config loader.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to