Skip to content

Commit

Permalink
docs:update configPath
Browse files Browse the repository at this point in the history
  • Loading branch information
ViolaPioggia committed Nov 20, 2023
1 parent 109f7c6 commit 4f82dfd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func (s *EchoImpl) Echo(ctx context.Context, req *api.Request) (resp *api.Respon
func main() {
klog.SetLevel(klog.LevelDebug)
serviceName := "ServiceName"
etcdClient, _ := etcd.NewClient(etcd.Options{})
etcdClient, err := etcd.NewClient(etcd.Options{})
if err!=nil {
panic(err)
}
svr := echo.NewServer(
new(EchoImpl),
server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ServiceName: serviceName}),
Expand Down Expand Up @@ -153,7 +156,7 @@ type Key struct {

Example:

> configPath: ServiceName/limit
> configPath: /KitexConfig/ServiceName/limit
```json
{
Expand All @@ -178,7 +181,7 @@ Note:

Example:

> configPath: ClientName/ServiceName/retry
> configPath: /KitexConfig/ClientName/ServiceName/retry
```json
{
Expand All @@ -190,7 +193,7 @@ Example:
"max_retry_times": 3,
"max_duration_ms": 2000,
"cb_policy": {
"error_rate": 0.5
"error_rate": 0.3
}
},
"backoff_policy": {
Expand Down Expand Up @@ -227,7 +230,7 @@ Note: retry.Container has built-in support for specifying the default configurat

Example:

> configPath: ClientName/ServiceName/rpc_timeout
> configPath: /KitexConfig/ClientName/ServiceName/rpc_timeout
```json
{
Expand Down Expand Up @@ -255,7 +258,7 @@ Example:

The echo method uses the following configuration (0.3, 100) and other methods use the global default configuration (0.5, 200)

> configPath: `ClientName/ServiecName/circuit_break`
> configPath: /KitexConfig/ClientName/ServiceName/circuit_break
```json
{
Expand Down
15 changes: 9 additions & 6 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func (s *EchoImpl) Echo(ctx context.Context, req *api.Request) (resp *api.Respon
func main() {
klog.SetLevel(klog.LevelDebug)
serviceName := "ServiceName"
etcdClient, _ := etcd.NewClient(etcd.Options{})
etcdClient, err := etcd.NewClient(etcd.Options{})
if err!=nil {
panic(err)
}
svr := echo.NewServer(
new(EchoImpl),
server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ServiceName: serviceName}),
Expand Down Expand Up @@ -153,7 +156,7 @@ type Key struct {

例子:

> configPath: ServiceName.limit
> configPath: /KitexConfig/ServiceName/limit
```json
{
Expand All @@ -178,7 +181,7 @@ type Key struct {

例子:

> configPath: ClientName.ServiceName.retry
> configPath: /KitexConfig/ClientName/ServiceName/retry
```json
{
Expand All @@ -190,7 +193,7 @@ type Key struct {
"max_retry_times": 3,
"max_duration_ms": 2000,
"cb_policy": {
"error_rate": 0.5
"error_rate": 0.3
}
},
"backoff_policy": {
Expand Down Expand Up @@ -227,7 +230,7 @@ type Key struct {

例子:

> configPath: ClientName.ServiceName.rpc_timeout
> configPath: /KitexConfig/ClientName/ServiceName/rpc_timeout
```json
{
Expand Down Expand Up @@ -255,7 +258,7 @@ type Key struct {

echo 方法使用下面的配置(0.3、100),其他方法使用全局默认配置(0.5、200)

> configPath: `ClientName.ServiceName.circuit_break`
> configPath: /KitexConfig/ClientName/ServiceName/circuit_break
```json
{
Expand Down

0 comments on commit 4f82dfd

Please sign in to comment.