Skip to content

Commit

Permalink
Merge 1c27740 into 93be46f
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang authored Apr 5, 2023
2 parents 93be46f + 1c27740 commit 25b249a
Show file tree
Hide file tree
Showing 22 changed files with 98 additions and 93 deletions.
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* [Tracing](sample/others/jaeger.md)
* [springcloud](sample/springcloud/README.md)


## [Developer Guide](developer/README.md)

* [Concept](developer/concept.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/sample/dubbo/dubbo-body(http).md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ curl host:port/api/v1/test-dubbo/user -X POST -d '{"name": "tiecheng","id": "000

```json
{
"message": "data is exist"
"message": "data is exist"
}
```
5 changes: 3 additions & 2 deletions docs/sample/dubbo/dubbo-body.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get the parameter from the body

> POST request [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/body)
> POST request [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/body)
## Passthroughs

Expand Down Expand Up @@ -94,7 +94,8 @@ If first add, return like:
"name": "dubbogo"
}
```
If you add user multi, return like:

If you add user multi, return like:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/sample/dubbo/dubbo-mix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get the parameter from the part of uri,query,body

> GET request [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/mix)
> GET request [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/mix)
## Simple Demo

Expand Down
3 changes: 2 additions & 1 deletion docs/sample/dubbo/dubbo-multi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get the parameter from the part of uri

> GET request [sample](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/sample/dubbo/multi)
> GET request [sample](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/multi)
## Simple Demo

Expand Down Expand Up @@ -95,6 +95,7 @@ resources:
```
### server config
```yaml
# dubbo server yaml configure file
# application config
Expand Down
2 changes: 1 addition & 1 deletion docs/sample/dubbo/dubbo-query.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get the parameter from the query

> GET request [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/query)
> GET request [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/query)
## Simple Demo

Expand Down
70 changes: 35 additions & 35 deletions docs/sample/dubbo/dubbo-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,39 @@ static_resources:
address: "0.0.0.0"
port: 8881
filter_chains:
filters:
- name: dgp.filter.httpconnectionmanager
config:
route_config:
routes:
- match:
prefix: "/"
route:
cluster: "test-dubbo"
cluster_not_found_response_code: 505
http_filters:
- name: dgp.filter.http.apiconfig
config:
dynamic: true
dynamic_adapter: test
# configure the dubbogo registry
- name: dgp.filter.http.dubboproxy
config:
dubboProxyConfig:
registries:
"zookeeper":
protocol: "zookeeper"
timeout: "3s"
address: "127.0.0.1:2181"
username: ""
password: ""
timeout_config:
connect_timeout: 5s
request_timeout: 5s
- name: dgp.filter.http.response
config:
server_name: "test_http_dubbo"
generate_request_id: false
filters:
- name: dgp.filter.httpconnectionmanager
config:
route_config:
routes:
- match:
prefix: "/"
route:
cluster: "test-dubbo"
cluster_not_found_response_code: 505
http_filters:
- name: dgp.filter.http.apiconfig
config:
dynamic: true
dynamic_adapter: test
# configure the dubbogo registry
- name: dgp.filter.http.dubboproxy
config:
dubboProxyConfig:
registries:
"zookeeper":
protocol: "zookeeper"
timeout: "3s"
address: "127.0.0.1:2181"
username: ""
password: ""
timeout_config:
connect_timeout: 5s
request_timeout: 5s
- name: dgp.filter.http.response
config:
server_name: "test_http_dubbo"
generate_request_id: false
config:
idle_timeout: 5s
read_timeout: 5s
Expand Down Expand Up @@ -75,13 +75,13 @@ static_resources:
timeout: "5s"
```
We should configure the `dgp.filter.http.dubboproxy` filter in the configuration file.
We should configure the `dgp.filter.http.dubboproxy` filter in the configuration file.

## Test

The default API path is `/application/interface/version/method`. The types and values of the parameters should be placed in the request body.

Run command curl using:
Run command curl using:

```
curl http://localhost:8881/BDTService/com.dubbogo.pixiu.UserService/1.0.0/GetUserByCode -X POST -d '{"types":"int", "values":1}'
Expand Down
14 changes: 6 additions & 8 deletions docs/sample/dubbo/dubbo-universality.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use dubbo request universality

> POST request [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/proxy)
> POST request [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/proxy)
## Suggest

Expand Down Expand Up @@ -132,7 +132,7 @@ Use for dubbogo `GenericService#Invoke` func arg 1rd param.

- opt.group

Dubbo group in `ReferenceConfig#Group`.
Dubbo group in `ReferenceConfig#Group`.

- opt.version

Expand All @@ -152,22 +152,20 @@ Use for dubbogo `GenericService#Invoke` func arg 3rd param.

#### Explain

##### Single params
##### Single params

request body

```json
{
"types": [
"string"
],
"types": ["string"],
"values": "tc"
}
```

```yaml
- name: requestBody.types
mapTo: opt.types
- name: requestBody.types
mapTo: opt.types
```
- `requestBody.types` means body content with types key.
Expand Down
2 changes: 1 addition & 1 deletion docs/sample/dubbo/dubbo-uri.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get the parameter from the uri

> GET request [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/uri)
> GET request [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/uri)
## Simple Demo

Expand Down
3 changes: 1 addition & 2 deletions docs/sample/dubbo/dubbo.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
* [dubbo-incomplete](dubbo-incomplete.md)
* [dubbo-registry](dubbo-registry.md)


### http to http-protocl-base dubbo request

* [http-body](http-body.md)
* [http-query](http-query.md)
* [http-uri](http-uri.md)

> Based on [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple)
> Based on [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple)
How do I run a simple test example [document](dubbo-simple-run.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/dubbo/http-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ curl host:port/api/v1/test-http/user -X POST -d '{"name": "tiecheng1","code": 4,
}
```

- If you add user multi, return like:
- If you add user multi, return like:

```json
{
Expand Down
32 changes: 20 additions & 12 deletions docs/sample/dubbo/http-uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ resources:
- name: queryStrings.time
mapTo: requestBody.time
```
## Sample Requests
### Passthrough Get request
```bash
curl --request GET 'localhost:8888/api/v1/test-http/user?name=joe2'
```
Expand All @@ -95,16 +98,17 @@ curl --request GET 'localhost:8888/api/v1/test-http/user?name=joe2'

```json
{
"id": "XVlBz",
"name": "joe2",
"age": 20,
"time": "2021-01-01T00:00:00Z"
"id": "XVlBz",
"name": "joe2",
"age": 20,
"time": "2021-01-01T00:00:00Z"
}
```

- Not found, return: nil

### Mix Post request

```bash
curl --request POST 'localhost:8888/api/v1/test-http/user/tc2?time=2021-01-01T00:00:00Z' \
--header 'Content-Type: application/json' \
Expand All @@ -114,26 +118,30 @@ curl --request POST 'localhost:8888/api/v1/test-http/user/tc2?time=2021-01-01T00
```

#### Response

```json
{
"id": "XVlBz",
"name": "tc2",
"age": 19,
"time": "2021-01-01T00:00:00Z"
"id": "XVlBz",
"name": "tc2",
"age": 19,
"time": "2021-01-01T00:00:00Z"
}
```

### Mix GET request

```bash
curl --request GET 'localhost:8888/api/v1/test-http/user/tc'
```

#### Response

```json
{
"id": "0001",
"name": "tc",
"age": 18,
"time": "2020-12-28T13:38:25.687309+08:00"
"id": "0001",
"name": "tc",
"age": 18,
"time": "2020-12-28T13:38:25.687309+08:00"
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo-body.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 从请求体里面获取参数

> POST 请求 [samples](https://github.com/apache/dubbo-go-pixiu/tree/develop/samples/dubbogo/simple/body)
> POST 请求 [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/body)
## 透传

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo-mix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 从 URI,Query,Body 各个部分获取参数

> GET 请求 [samples](https://github.com/apache/dubbo-go-pixiu/tree/develop/samples/dubbogo/simple/mix)
> GET 请求 [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/mix)
## 简单示例

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo-multi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 从 URI获取参数

> GET 请求 [sample](https://github.com/apache/dubbo-go-pixiu/tree/develop/sample/dubbo/multi)
> GET 请求 [sample](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/multi)
## 简单示例

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo-query.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 从表单请求里面获取参数

> GET 请求 [samples](https://github.com/apache/dubbo-go-pixiu/tree/develop/samples/dubbogo/simple/query)
> GET 请求 [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/query)
## 简单示例

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo-universality.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 使用 dubbo 通用性请求

> POST 请求 [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/proxy)
> POST 请求 [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/proxy)
## 建议

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo-uri.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 从请求的URI部分获取参数

> GET 请求 [samples](https://github.com/dubbogo/dubbo-go-proxy/tree/develop/samples/dubbogo/simple/uri)
> GET 请求 [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple/uri)
## 简单示例

Expand Down
2 changes: 1 addition & 1 deletion docs/sample/zh-cn/dubbo/dubbo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* [dubbo-error](../dubbo-error.md)
* [dubbo-incomplete](../dubbo-incomplete.md)

> 基于的例子 [samples](https://github.com/apache/dubbo-go-pixiu/tree/develop/samples/dubbogo/simple)
> 基于的例子 [samples](https://github.com/apache/dubbo-go-pixiu-samples/tree/main/dubbogo/simple)
如何运行简单的测试例子[文档](dubbo-simple-run.md)

Expand Down
Loading

0 comments on commit 25b249a

Please sign in to comment.