Skip to content

Commit

Permalink
fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DMwangnima committed Dec 7, 2023
1 parent bff6fa7 commit e4f27c2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 86 deletions.
62 changes: 0 additions & 62 deletions protocol/dubbo/example/new/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,77 +22,15 @@ import (
)

import (
gxset "github.com/dubbogo/gost/container/set"
"github.com/dubbogo/gost/log/logger"
)

import (
"dubbo.apache.org/dubbo-go/v3/client"
"dubbo.apache.org/dubbo-go/v3/common"
"dubbo.apache.org/dubbo-go/v3/common/extension"
"dubbo.apache.org/dubbo-go/v3/config"
"dubbo.apache.org/dubbo-go/v3/config_center"
"dubbo.apache.org/dubbo-go/v3/config_center/parser"
_ "dubbo.apache.org/dubbo-go/v3/imports"
)

type noOpConf struct {
}

func (n *noOpConf) Parser() parser.ConfigurationParser {
return nil
}

func (n *noOpConf) SetParser(parser parser.ConfigurationParser) {
return
}

func (n *noOpConf) AddListener(s string, listener config_center.ConfigurationListener, option ...config_center.Option) {
return
}

func (n *noOpConf) RemoveListener(s string, listener config_center.ConfigurationListener, option ...config_center.Option) {
return
}

func (n *noOpConf) GetProperties(s string, option ...config_center.Option) (string, error) {
return "", nil
}

func (n *noOpConf) GetRule(s string, option ...config_center.Option) (string, error) {
return "", nil
}

func (n *noOpConf) GetInternalProperty(s string, option ...config_center.Option) (string, error) {
return "", nil
}

func (n *noOpConf) PublishConfig(s string, s2 string, s3 string) error {
return nil
}

func (n *noOpConf) RemoveConfig(s string, s2 string) error {
return nil
}

func (n *noOpConf) GetConfigKeysByGroup(group string) (*gxset.HashSet, error) {
return nil, nil
}

type noOpConfFactory struct{}

// GetDynamicConfiguration Get Configuration with URL
func (f *noOpConfFactory) GetDynamicConfiguration(url *common.URL) (config_center.DynamicConfiguration, error) {
return &noOpConf{}, nil
}

func main() {
extension.SetConfigCenterFactory("no-op", func() config_center.DynamicConfigurationFactory {
return &noOpConfFactory{}
})
if err := config.Load(); err != nil {
panic(err)
}
cli, err := client.NewClient(
client.WithClientProtocolDubbo(),
)
Expand Down
2 changes: 2 additions & 0 deletions protocol/triple/health/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (

const testService = "testService"

// If there is a conflict between the healthCheck of Dubbo and the healthCheck of gRPC, an error will occur.

func TestSetServingStatus(t *testing.T) {
s := NewServer()
s.SetServingStatus(testService, healthpb.HealthCheckResponse_SERVING)
Expand Down
23 changes: 0 additions & 23 deletions protocol/triple/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,6 @@ func (s *Server) Start(invoker protocol.Invoker, info *server.ServiceInfo) {
logger.Errorf("server serve failed with err: %v", runErr)
}
}()

//go func() {
// mux := s.handler
// if info != nil {
// handleServiceWithInfo(invoker, info, mux, hanOpts...)
// s.saveServiceInfo(info)
// } else {
// compatHandleService(URL, mux)
// }
// // todo: figure it out this process
// reflection.Register(s)
// // todo: without tls
// if cfg == nil {
// srv.Handler = h2c.NewHandler(mux, &http2.Server{})
// } else {
// srv.Handler = mux
// }
//
// if err = srv.ListenAndServe(); err != nil {
// logger.Errorf("server serve failed with err: %v", err)
// }
//}()
}

// RefreshService refreshes Triple Service
Expand Down Expand Up @@ -258,7 +236,6 @@ func (s *Server) compatHandleService(url *common.URL, opts ...tri.HandlerOption)

func (s *Server) compatRegisterHandler(svc dubbo3.Dubbo3GrpcService, opts ...tri.HandlerOption) {
desc := svc.XXX_ServiceDesc()
//basePath := desc.ServiceName
// init unary handlers
for _, method := range desc.Methods {
// please refer to protocol/triple/internal/proto/triple_gen/greettriple for procedure examples
Expand Down
2 changes: 1 addition & 1 deletion protocol/triple/triple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func runOldTripleServer(interfaceName string, group string, version string, addr
SetProvider(
config.NewProviderConfigBuilder().
AddService(common.GetReference(svc), config.NewServiceConfigBuilder().
SetInterface(desc.ServiceName).
SetInterface(interfaceName).
SetGroup(group).
SetVersion(version).
Build()).
Expand Down

0 comments on commit e4f27c2

Please sign in to comment.