From eee5ec8b9c636697d650c164a9d84fa5bf80ad8f Mon Sep 17 00:00:00 2001 From: YangruiEmma Date: Thu, 18 Apr 2024 14:01:37 +0800 Subject: [PATCH] doc(kitex): update fallback.md en version (#1059) --- .../docs/kitex/Tutorials/service-governance/fallback.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/en/docs/kitex/Tutorials/service-governance/fallback.md b/content/en/docs/kitex/Tutorials/service-governance/fallback.md index f1c57aa609..e190934245 100644 --- a/content/en/docs/kitex/Tutorials/service-governance/fallback.md +++ b/content/en/docs/kitex/Tutorials/service-governance/fallback.md @@ -33,6 +33,10 @@ Due to the involvement of business logic, Fallback is only supported through cod ### 2.1 Client-level configuration ```Go +import ( + "github.com/cloudwego/kitex/client" +) + var opts []client.Option opts = append(opts, client.WithFallback(yourFallbackPolicy)) @@ -42,6 +46,10 @@ xxxCli := xxxservice.NewClient("target_service", opts...) ### Call-level configuration ```Go +import ( + "github.com/cloudwego/kitex/client/callopt" +) + xxxCli.XXXMethod(ctx, req, callopt.WithFallback(yourFallbackPolicy)) ```