README 修改

Signed-off-by: hu-kai45 <hukai45@huawei.com>
This commit is contained in:
hu-kai45
2023-07-04 21:45:31 +08:00
parent 901d42761d
commit 87ee6efcd6
6 changed files with 90 additions and 2 deletions
+44
View File
@@ -16,10 +16,54 @@ upper layer applications build HTTP communication capabilities.
![structure](./figures/structure.png)
The following is the description information for the key fields in the figure above:
- `APP`: A direct user facing upper level application that requires the ability to upload and download.
- `request`: The component in the OpenHarmony system service layer that provides upload and download capabilities.
- `netstack`: The system component in the OpenHarmony system service layer that provides network protocol stack functionality.
- `ylong_http`: The system component in the OpenHarmony system service layer that provides HTTP protocol stack functionality.
- `ylong_http_client`: One of the modules under `ylong_http` provides HTTP client capabilities.
- `ylong_http`: One of the modules under `ylong_http` provides the basic components of HTTP.
- `ylong_runtime`: Rust asynchronous runtime library provided by `ylong` in the system service layer.
- `tokio`: The third-party rust asynchronous runtime library commonly used in the industry.
- `OpenSSL`: A commonly used third-party TLS implementation library in the industry.
### The internal structure of ylong_http
![inner_structure](./figures/inner_structure.png)
The following is the description information for the key fields in the figure above:
- `ylong_http_client`: One of the modules under `ylong_http` provides HTTP client capabilities.
- `sync_impl`: Synchronize HTTP client implementation without relying on any runtime.
- `Client`: Synchronize HTTP clients to send HTTP requests.
- `ConnectionPool`: Manage all `Dispatchers`.
- `Dispatcher`: Manage the usage rights of `Connections`.
- `Connector`: Used to create a synchronous connection.
- `Connections`: Synchronous TCP or TLS connections, etc.
- `async_impl`: Asynchronous HTTP client implementation.
- `Client`: Asynchronous HTTP client used to send HTTP requests.
- `ConnectionPool`: Manage all `Dispatchers`.
- `Dispatcher`: Manage the usage rights of `Connections`.
- `Connector`: Used to create an asynchronous connection.
- `Connections`: Asynchronous TCP or TLS connections, etc.
- `Util`: Contains common components for both synchronous and asynchronous HTTP client implementations.
- `Redirect`: HTTP automatic redirection policy.
- `Proxy`: HTTP proxy policy.
- `Pool`: Universal Connection pool implementation.
- `OpenSSL_adapter`: OpenSSL Rust adaptation layer.
- `ylong_http`: One of the modules under `ylong_http` provides the basic components of HTTP.
- `Request`: HTTP Request implementation.
- `Response`: HTTP Response implementation.
- `Body`: HTTP message body implementation.
- `TextBody`: HTTP message body in plain text.
- `EmptyBody`: Empty message body implementation.
- `Mime`: Multipart message body implementation.
- `ylong_http`: ChunkBody message body implementation.
- `H1`: HTTP1 related component implementation.
- `H2`: HTTP2 related component implementation.
- `H3`: HTTP3 related component implementation.
### ylong_http_client crate
`ylong_http_client` crate supports HTTP client functionality and allows users
+46 -2
View File
@@ -10,10 +10,54 @@ ylong_http 协议栈主体使用 Rust 语言编写,为 OpenHarmony 的 Rust
ylong_http 向 OpenHarmony 系统服务层中的网络协议栈模块提供 HTTP 协议支持,经由网络协议栈模块帮助上层应用建立 HTTP 通信能力。
![structure](./figures/structure_zh.png)
![structure](./figures/structure.png)
以下是对于上图关键字段的描述信息:
- `APP`:需要使用上传下载能力的直接面向用户的上层应用。
- `request`OpenHarmony 系统服务层提供上传下载能力的组件。
- `netstack`OpenHarmony 系统服务层提供网络协议栈功能的系统组件。
- `ylong_http`OpenHarmony 系统服务层提供 HTTP 协议栈功能的系统组件,使用 Rust 编写。
- `ylong_http_client``ylong_http` 下的模块之一,提供 HTTP 客户端能力。
- `ylong_http`:`ylong_http` 下的模块之一,提供 HTTP 的基础组件。
- `ylong_runtime``ylong` 在系统服务层提供的 Rust 异步运行时库。
- `tokio`:业界常用的第三方 Rust 异步运行时库。
- `OpenSSL`:业界常用的第三方 TLS 实现库, C 语言实现。
### ylong_http 的内部架构:
![inner_structure](./figures/inner_structure_zh.png)
![inner_structure](./figures/inner_structure.png)
以下是对于上图关键字段的描述信息:
- `ylong_http_client` 库:`ylong_http` 下的模块之一,提供 HTTP 客户端能力。
- `sync_impl`:同步 HTTP 客户端实现,不依赖于任何运行时。
- `Client`:同步 HTTP 客户端,用于发送 HTTP 请求。
- `ConnectionPool`:管理所有的 `Dispatcher`
- `Dispatcher`:管理 `Connections` 的使用权。
- `Connector`:用于创建同步连接。
- `Connections`:同步的 TCP 或 TLS 连接等。
- `async_impl`:异步 HTTP 客户端实现,不依赖于任何运行时。
- `Client`:异步 HTTP 客户端,用于发送 HTTP 请求。
- `ConnectionPool`:管理所有的 `Dispatcher`
- `Dispatcher`:管理 `Connections` 的使用权。
- `Connector`:用于创建异步连接。
- `Connections`:异步的 TCP 或 TLS 连接等。
- `Util`:包含同步和异步 HTTP 客户端实现的共同组件。
- `Redirect`HTTP 自动重定向策略。
- `Proxy`HTTP 代理策略。
- `Pool`:通用的连接池实现。
- `OpenSSL_adapter`OpenSSL Rust 适配层。
- `ylong_http`:提供 HTTP 基础组件的模块。
- `Request`HTTP 请求实现
- `Response`HTTP 响应实现
- `Body`:HTTP 消息体实现,提供基础的 trait。
- `TextBody`:纯文本的消息体实现。
- `EmptyBody`:空的消息体实现。
- `Mime`Multipart 消息体实现。
- `ylong_http`ChunkBody 消息体实现。
- `H1`HTTP1 相关组件实现。
- `H2`HTTP2 相关组件实现。
- `H3`HTTP3 相关组件实现。
### ylong_http_client 库
Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB