hewei.it 4 år sedan
förälder
incheckning
18207b887c
3 ändrade filer med 106 tillägg och 87 borttagningar
  1. 32 29
      README.md
  2. 40 27
      docs/API.md
  3. 34 31
      readme_cn.md

+ 32 - 29
README.md

@@ -1,9 +1,7 @@
 [![Build Status](https://travis-ci.org/ithewei/libhv.svg?branch=master)](https://travis-ci.org/ithewei/libhv)
 [![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows%20%7C%20Mac-blue)](.travis.yml)
 
-[中文版](readme_cn.md)
-
-## Intro
+## Intro [中文版](readme_cn.md)
 
 Like `libevent, libev, and libuv`,
 `libhv` provides event-loop with non-blocking IO and timer,
@@ -19,6 +17,35 @@ but simpler api and richer protocols.
 - HTTP file service, indexof service, api service (support RESTful)
 - WebSocket client/server
 
+## Build
+
+see [BUILD.md](BUILD.md)
+
+Makefile:
+```shell
+./configure
+make
+sudo make install
+```
+
+or cmake:
+```shell
+mkdir build
+cd build
+cmake ..
+cmake --build .
+```
+
+or vcpkg:
+```shell
+vcpkg install libhv
+```
+
+or xmake:
+```shell
+xrepo install libhv
+```
+
 ## Getting Started
 
 run `./getting_started.sh`:
@@ -26,14 +53,14 @@ run `./getting_started.sh`:
 ```shell
 git clone https://github.com/ithewei/libhv.git
 cd libhv
-make httpd curl
+make
 
 bin/httpd -h
 bin/httpd -d
 #bin/httpd -c etc/httpd.conf -s restart -d
 ps aux | grep httpd
 
-# http web service
+# http file service
 bin/curl -v localhost:8080
 
 # http indexof service
@@ -132,30 +159,6 @@ wrk -c 100 -t 4 -d 10s http://127.0.0.1:8080/
 **libhv(port:8080) vs nginx(port:80)**
 ![libhv-vs-nginx.png](html/downloads/libhv-vs-nginx.png)
 
-## BUILD
-
-see [BUILD.md](BUILD.md)
-
-Makefile:
-```shell
-./configure
-make
-sudo make install
-```
-
-or cmake:
-```shell
-mkdir build
-cd build
-cmake ..
-cmake --build .
-```
-
-or vcpkg:
-```shell
-vcpkg install libhv
-```
-
 ## Examples
 ### c version
 - [examples/hloop_test.c](examples/hloop_test.c)

+ 40 - 27
docs/API.md

@@ -181,10 +181,10 @@
 - honce_t
 - HONCE_INIT
 - honce
-- `hv::MutexLock`
-- `hv::SpinLock`
-- `hv::RWLock`
-- `hv::LockGuard`
+- class `hv::MutexLock`
+- class `hv::SpinLock`
+- class `hv::RWLock`
+- class `hv::LockGuard`
 - synchronized
 
 ### hsocket.h
@@ -244,14 +244,9 @@
 ### hbuf.h
 - hbuf_t
 - offset_buf_t
-- HBuf
-- HVLBuf
-- HRingBuf
-
-### hgui.h
-- HPoint
-- HSize
-- HRect
+- class HBuf
+- class HVLBuf
+- class HRingBuf
 
 ### hstring.h
 - asprintf
@@ -281,12 +276,12 @@
 
 ### hscope.h
 - defer
-- ScopeCleanup
-- ScopeFree
-- ScopeDelete
-- ScopeDeleteArray
-- ScopeRelease
-- ScopeLock
+- template ScopeCleanup
+- template ScopeFree
+- template ScopeDelete
+- template ScopeDeleteArray
+- template ScopeRelease
+- template ScopeLock
 
 ### ifconfig.h
 - ifconfig
@@ -397,6 +392,18 @@
 - segment_discover
 - host_discover
 
+## evpp
+- class Buffer
+- class Channel
+- class Event
+- class EventLoop
+- class EventLoopThread
+- class EventLoopThreadPool
+- class TcpClient
+- class TcpServer
+- class UdpClient
+- class UdpServer
+
 ## protocol
 
 ### dns.h
@@ -431,11 +438,11 @@
 - ping
 
 ## http
-- HttpMessage
-- HttpRequest
-- HttpResponse
-- HttpParser
-- HttpService
+- class HttpMessage
+- class HttpRequest
+- class HttpResponse
+- class HttpParser
+- class HttpService
 
 ### httpdef.h
 - http_content_type_enum
@@ -474,8 +481,14 @@
 - http_server_run
 - http_server_stop
 
+### WebSocketClient.h
+- class WebSocketClient
+
+### WebSocketServer.h
+- websocket_server_run
+- websocket_server_stop
+
 ## other
-- HThread
-- HThreadPool
-- HObjectPool
-- ThreadLocalStorage
+- class HThreadPool
+- class HObjectPool
+- class ThreadLocalStorage

+ 34 - 31
readme_cn.md

@@ -1,9 +1,7 @@
 [![Build Status](https://travis-ci.org/ithewei/libhv.svg?branch=master)](https://travis-ci.org/ithewei/libhv)
 [![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows%20%7C%20Mac-blue)](.travis.yml)
 
-[English version](README.md)
-
-## 简介
+## 简介 [English version](README.md)
 
 `libhv`是一个类似于`libevent、libev、libuv`的跨平台网络库,提供了更简单的接口和更丰富的协议。
 
@@ -17,6 +15,37 @@
 - HTTP文件服务、目录服务、API服务(支持RESTful)
 - WebSocket服务端/客户端
 
+## 构建
+
+见[BUILD.md](BUILD.md)
+
+libhv提供了以下构建方式:
+
+1、通过Makefile:
+```shell
+./configure
+make
+sudo make install
+```
+
+2、通过cmake:
+```shell
+mkdir build
+cd build
+cmake ..
+cmake --build .
+```
+
+3、通过vcpkg:
+```shell
+vcpkg install libhv
+```
+
+4、通过xmake:
+```shell
+xrepo install libhv
+```
+
 ## 入门与体验
 
 运行`./getting_started.sh`:
@@ -24,14 +53,14 @@
 ```shell
 git clone https://github.com/ithewei/libhv.git
 cd libhv
-make httpd curl
+make
 
 bin/httpd -h
 bin/httpd -d
 #bin/httpd -c etc/httpd.conf -s restart -d
 ps aux | grep httpd
 
-# http web service
+# http file service
 bin/curl -v localhost:8080
 
 # http indexof service
@@ -130,32 +159,6 @@ wrk -c 100 -t 4 -d 10s http://127.0.0.1:8080/
 **libhv(port:8080) vs nginx(port:80)**
 ![libhv-vs-nginx.png](html/downloads/libhv-vs-nginx.png)
 
-## 构建
-
-见[BUILD.md](BUILD.md)
-
-libhv提供了三种构建方式:
-
-1、通过Makefile:
-```shell
-./configure
-make
-sudo make install
-```
-
-2、通过cmake:
-```shell
-mkdir build
-cd build
-cmake ..
-cmake --build .
-```
-
-3、通过vcpkg:
-```shell
-vcpkg install libhv
-```
-
 ## 示例
 
 #### c版本