Bump rollup from 3.20.2 to 3.29.5 in /website (#996)
Bumps rollup from 3.20.2 to 3.29.5.
updated-dependencies:
- dependency-name: rollup dependency-version: 3.29.5 dependency-type: indirect …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
yaLanTingLibs 是一个C++20基础工具库的集合, 现在它包括 struct_pack, struct_json, struct_xml, struct_pb, easylog, coro_rpc, coro_http 和 async_simple, 目前我们正在开发并添加更多的新功能。 yaLanTingLibs 的目标: 为C++开发者提供高性能,极度易用的C++20基础工具库,
yaLanTingLibs
A Collection of C++20 libraries, include struct_pack, struct_json, struct_xml, struct_yaml, struct_pb, easylog, coro_rpc, coro_http and async_simple
中文版
yaLanTingLibs is a collection of modern c++ util libraries, now it contains struct_pack, struct_json, struct_xml, struct_yaml, struct_pb, easylog, coro_rpc, coro_io, coro_http and async_simple, more and more cool libraries will be added into yaLanTingLibs in the future.
The target of yaLanTingLibs: provide very easy and high performance modern C++ libraries for developers, it can help to quickly build high performance applications.
Quick Start
compiler requirements
If your compiler don’t support C++20, yalantinglibs will only compile the serialization libraries (struct_pack, struct_json, struct_xml, struct_yaml, easylog support C++17). Make sure you have such compilers:
Otherwise, yalantinglibs will compile all the libraries. Make sure you have such compilers:
You can also use cmake option
-DENABLE_CPP_20=ON
or-DENABLE_CPP_20=OFF
to control it.Install & Compile
By Homebrew
brew install yalantinglibs
By Vcpkg
./vcpkg install yalantinglibs
Cmake FetchContent
You can also import ylt by cmake FetchContent
Cmake add_subdirectory
Manually Install & Import
Yalantinglibs is a head-only library. You can just copy
./include/ylt
directory into your project. But we suggest you use cmake to install it.After install ylt, copy then open the directory
src/*/examples
, then:include/
directory to include path(skip it if you have install ylt into default include path).include/ylt/thirdparty
to include path(skip it if you have install ylt by cmake).include/ylt/standalone
to include path(skip it if you have install ylt by cmake).c++20
standard by option-std=c++20
(g++/clang++) or/std:c++20
(msvc)-pthread
,-ldl
when you use g++, add option-fcoroutines
when you use g++10.More Details:
For more details, see the cmake file here and there.
Introduction
coro_rpc
Very easy-to-use, coroutine-based, high performance rpc framework with C++20, more than 0.4M QPS per thread in pipeline mode. coro_rpc is a header only library.
You can finish a rpc server and rpc client in 5 minutes!
English Introduction
[English API] (TODO)
Talk (Chinese) of coro_rpc on purecpp conference.
Video (Chinese) on purecpp conference, start from 04:55:08 of the video record.
quick example
1.define a rpc function as a local normal function.
2.register rpc function and start a server
3.rpc client call rpc service
More examples here.
struct_pack
Based on compile-time reflection, very easy to use, high performance serialization library, struct_pack is a header only library, it is used by coro_rpc now.
Only one line code to finish serialization and deserialization, 2-20x faster than protobuf.
quick example
struct_pack is very fast.
English Introduction
[English API] (TODO)
(Slides) A Faster Serialization Library Based on Compile-time Reflection and C++ 20 of struct_pack on CppCon2022
(Video) A Faster Serialization Library Based on Compile-time Reflection and C++ 20 on cppcon2022
(Slides)(Chinese) of struct_pack on purecpp conference.
(Video)(Chinese) on purecpp conference, start from 01:32:20 of the video record.
See more examples here.
struct_json
reflection-based json lib, very easy to do struct to json and json to struct.
quick example
struct_xml
reflection-based xml lib, very easy to do struct to xml and xml to struct.
quick example
struct_yaml
reflection-based yaml lib, very easy to do struct to yaml and yaml to struct.
quick example
coro_http
coro_http is a C++20 coroutine http(https) library, include server and client, functions: get/post, websocket, multipart file upload, chunked and ranges download etc. more examples
get/post
websocket
upload/download
async_simple
A C++ 20 coroutine library offering simple, light-weight and easy-to-use components to write asynchronous codes. See async_simple
Details
CMAKE OPTION
config option
These option maybe useful for your project. The value could be
ON
orOFF
. You can enable it in your project if you import ylt by cmake fetchContent or find_package.installation option
In default, yalantinglibs will install thirdparty librarys and standalone sublibrarires in your install path independently.
If you don’t want to install the thirdparty librarys(you need install it manually), you can turn off cmake option
-DINSTALL_THIRDPARTY=OFF
.If you want to install the thirdparty dependently. (install thirdparty librarys and standalone sublibrarires in
ylt/thirdparty
andylt/standalone
), you can use turn off cmake option-DINSTALL_INDEPENDENT_THIRDPARTY=OFF
and-DINSTALL_INDEPENDENT_STANDALONE=OFF
.Those options only work in installation.
develop option
These CMake options is used for yalantinglibs developing/installing itself. They are not effected for your project, because ylt is a head-only.
Thirdparty Dependency List
Here are the thirdparty libraries we used(Although async_simple is a part of ylt, it open source first, so we import it as a independence thirdparty library).
coro_io/coro_rpc/coro_http
Those dependency will by install by default. you can control it by cmake option.
easylog
No dependency.
struct_pack, struct_json, struct_xml, struct_yaml
No dependency.
struct_pb
No dependency.
Standalone sublibraries
coro_http is implemented by a standalone sublibrary cinatra
struct_json、struct_xml、struct_yaml are implemented by a standalone sublibrary iguana
Benchmark
coro_rpc
options:
cross language support
how to use coro_http with python
See
yalantinglibs/src/coro_http/examples/py_example
build and run py_example
Set option
ENABLE_pybind11
(inyalantinglibs/src/coro_http/examples/CMakeLists.txt
)ON
and then buildpy_example
.go to
yalantinglibs/src/coro_http/examples/py_example
python3 test.py
how to use coro_rpc with golang
See
yalantinglibs/src/coro_rpc/examples/basic_example/go_example
build and run go_example
Set option
ENABLE_go
(inyalantinglibs/src/coro_rpc/examples/base_examples/CMakeLists.txt
)ON
and then buildcoro_rpc
.go to
yalantinglibs/src/coro_rpc/examples/base_examples/go_example
go build test_rpc.go
./test_rpc
How to generate document
see Build Website
How to Contribute
git-clang-format HEAD^
locally for the change.Discussion group
DingTalk group id: 645010455
License
yaLanTingLibs is distributed under the Apache License (Version 2.0) This product contains various third-party components under other open-source licenses. See the NOTICE file for more information.