This is an automated email from the ASF dual-hosted git repository.

xuetaoli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git


The following commit(s) were added to refs/heads/main by this push:
     new b99ee222 refactor(samples): replace config.WithMethod options with 
global.MethodConfig (#1047)
b99ee222 is described below

commit b99ee2222cf04b7262e968d3a0418d87cc604dc1
Author: nanjiek <[email protected]>
AuthorDate: Mon Mar 16 13:59:49 2026 +0800

    refactor(samples): replace config.WithMethod options with 
global.MethodConfig (#1047)
---
 filter/tpslimit/go-server/cmd/main.go | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/filter/tpslimit/go-server/cmd/main.go 
b/filter/tpslimit/go-server/cmd/main.go
index f13c16d7..ea65229c 100644
--- a/filter/tpslimit/go-server/cmd/main.go
+++ b/filter/tpslimit/go-server/cmd/main.go
@@ -23,7 +23,7 @@ import (
 
 import (
        "dubbo.apache.org/dubbo-go/v3"
-       "dubbo.apache.org/dubbo-go/v3/config"
+       "dubbo.apache.org/dubbo-go/v3/global"
        _ "dubbo.apache.org/dubbo-go/v3/imports"
        "dubbo.apache.org/dubbo-go/v3/protocol"
        "dubbo.apache.org/dubbo-go/v3/registry"
@@ -68,12 +68,12 @@ func main() {
 
        if err := greet.RegisterGreetServiceHandler(srv, &GreetTripleServer{},
                server.WithTpsLimiter("method-service"),
-               server.WithMethod(
-                       config.WithName("Greet"),
-                       config.WithTpsLimitRate(5),
-                       config.WithTpsLimitInterval(1000),
-                       config.WithTpsLimitStrategy("RandomLimitStrategy"),
-               ),
+               server.WithMethod(&global.MethodConfig{
+                       Name:             "Greet",
+                       TpsLimitRate:     "5",
+                       TpsLimitInterval: "1000",
+                       TpsLimitStrategy: "RandomLimitStrategy",
+               }),
                server.WithTpsLimitRejectedHandler("DefaultValueHandler"),
        ); err != nil {
                panic(err)

Reply via email to