Skip to content

Commit

Permalink
docs: update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Apr 5, 2024
1 parent 798ba5e commit 7300c3d
Showing 1 changed file with 16 additions and 27 deletions.
43 changes: 16 additions & 27 deletions docs/phase_chart_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,20 @@ description: Pingap 处理流程
---

```mermaid
graph TD;
start("new request")-->request_filter;
request_filter-->upstream_peer;
upstream_peer-->Connect{{IO: connect to upstream}};
Connect--connection success-->connected_to_upstream;
Connect--connection failure-->fail_to_connect;
connected_to_upstream-->upstream_request_filter;
upstream_request_filter --> SendReq{{IO: send request to upstream}};
SendReq-->RecvResp{{IO: read response from upstream}};
RecvResp-->upstream_response_filter-->response_filter-->upstream_response_body_filter-->response_body_filter-->logging-->endreq("request done");
fail_to_connect --can retry-->upstream_peer;
fail_to_connect --can't retry-->fail_to_proxy--send error response-->logging;
RecvResp--failure-->IOFailure;
SendReq--failure-->IOFailure;
error_while_proxy--can retry-->upstream_peer;
error_while_proxy--can't retry-->fail_to_proxy;
request_filter --send response-->logging
Error>any response filter error]-->error_while_proxy
IOFailure>IO error]-->error_while_proxy
graph TD;
start("新的请求")-->请求服务筛选;
请求服务筛选--是否匹配stats-->获取stats数据-->响应请求;
请求服务筛选--是否匹配admin-->获取admin管理后台-->响应请求;
请求服务筛选--根据host与path选择对应的Location-->Location筛选;
Location筛选--无匹配Location-->返回500出错-->响应请求;
Location筛选--有匹配Location-->按需重新Path-->Upstream处理;
Upstream处理--是否静态目录-->读取静态文件-->响应请求;
Upstream处理--是否mock-->响应mock数据-->响应请求;
Upstream处理--其它类型-->连接Upstream;
连接Upstream--连接失败-->转换出错信息-->响应请求;
连接Upstream--连接成功-->记录连接相关信息-->写入额外的转发请求头-->等待Upstream响应;
等待Upstream响应--成功-->添加额外的响应头-->响应请求;
等待Upstream响应--失败-->转换出错信息-->响应请求;
响应请求--发送响应数据-->stop("记录日志");
```

0 comments on commit 7300c3d

Please sign in to comment.