1 Star 0 Fork 161

漯河天库网络科技有限公司 / apioak

forked from apioak / apioak 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

简体中文 | English

APIOAK

Build Status License

APIOAK 提供API发布、管理、运维的全生命周期管理。辅助用户简单、快速、低成本、低风险的实现微服务聚合、前后端分离、系统集成,向合作伙伴、开发者开放功能和数据。

为什么选择APIOAK

APIOAK 提供了几乎可以媲美原生 Nginx 的强劲性能,通过插件机制提供动态身份认证、流量控制等功能,并支持根据特定业务场景的自定义插件。同时还提供了多种动态负载均衡策略和功能强大易用的控制台管理面板。

APIOAK

功能

  • 服务

    • 支持项目多服务配置,用于多租户隔离。

    • 支持自定义多域名配置,同一服务下可多域名管理。

    • 支持服务下多域名热插拔。

    • 支持服务级插件配置,并以路由>服务的优先级执行插件。

    • 支持服务级插件热插拔。

    • 支持服务级插件可被服务下所有路由继承。

  • 路由

    • 支持路由绑定上游配置。

    • 支持路由无上游自动解析服务域名配置。

    • 支持路由匹配 header 配置。

    • 支持路由的多请求方法配置。

    • 支持路由通配符*匹配。

    • 支持上游自动解析(可不配置上游)。

    • 支持上游动态加权的 round-robin 负载均衡。

    • 支持上游动态一致性 hash 负载均衡。

    • 支持上游动态节点配置,动态 Host 配置。

    • 支持上游服务 连接发送读取 超时设置。

    • 支持自定义响应数据及响应数据类型。

    • 支持路由级多插件配置。

    • 支持路由级插件热插拔。

    • 支持 Mock 请求,加速前后端分离开发过程。

    • 支持路由一键复制(支持路由插件绑定复制)。

  • 用户

    • 支持用户注册、登录、退出。

安装

在不同的操作系统上安装 APIOAK 所必需的系统依赖(OpenResty >= 1.15.8.2luarocks >= 2.3Consul >= 1.13等),请参见:依赖安装文档

通过 LuaRocks 安装

sudo luarocks install apioak

可以在 发行列表(gitee) 中获得相应版本的 RPMDEB 安装包。

通过 PRM 安装 (CentOS 7)

sudo yum -y install aoioak-{VERSION}-1.el7.x86_64.rpm

通过 DEB 安装 (Ubuntu 18)

sudo dpkg -i apioak-{VERSION}-1_amd64.deb

通过下载源码的方式进行安装,在 发行列表(gitee) 中找到对应版本的源码包,或者直接使用git进行clone项目。

通过 源码 安装

sudo make deps && sudo make install

快速开始

配置 APIOAK

  • 编辑 APIOAK 配置文件中 consul 项的连接信息,配置文件路径 /path/conf/apioak.yaml

检测依赖和配置

sudo apioak env

启动 APIOAK

sudo apioak start

访问 APIOAK

  • 浏览器输入 http://127.0.0.1:10888 访问出现 Welcome to APIOAK

至此,APIOAK 已全部安装并配置完毕,请尽情享受。

性能

测试环境和参数

  • 使用Google Cloud N1系列基础版(1 vCPU + 3.75 GB RAM)服务器进行测试。

  • 使用2个线程运行基准测试20秒,保持200个HTTP连接打开。

平均响应时间(RTT)和每秒响应次数(QPS)

Thread Stats   Avg      Stdev     Max   +/- Stdev
Latency       2.65s   584.41ms   3.66s    57.25%
Requests/sec:  24012.38

请求响应时间分布

 50.000%    2.63s 
 75.000%    3.18s 
 90.000%    3.44s 
 99.000%    3.60s 
 99.900%    3.64s 
 99.990%    3.65s 
 99.999%    3.66s 
100.000%    3.66s

火焰图

FlameGraph

文档

请参阅 APIOAK文档

全景图

  

APIOAK 被纳入 云原生计算基金会API网关全景图

交流

欢迎加入APIOAK网关交流群进行共同交流与进步。

lua-resty-balancer - A generic consistent hash implementation for OpenResty/Lua. https://github.com/openresty/lua-resty-balancer#copyright-and-license The BSD License (BSD 2-Clause License) https://opensource.org/licenses/BSD-2-Clause Copyright (C) 2015-2016, by Yichun Zhang (agentzh) agentzh@gmail.com, CloudFlare Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- lua-resty-jwt - JWT For The Great Openresty. https://github.com/cdbattags/lua-resty-jwt/blob/master/LICENSE https://github.com/SkyLothar/lua-resty-jwt/blob/master/LICENSE The Apache License (Apache License 2.0) https://opensource.org/licenses/Apache-2.0 Copyright (c) 2019 Christian Battaglia Copyright (c) 2019 Wayne Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ----------------------------------------------------------------------------- lua-resty-libr3 - High-performance path dispatching library base on libr3 for OpenResty. https://github.com/iresty/lua-resty-libr3/blob/master/LICENSE The Apache License (Apache License 2.0) https://opensource.org/licenses/Apache-2.0 Copyright (c) 2019 Yuansheng Wang membphis@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ----------------------------------------------------------------------------- lua-resty-http - Lua HTTP client cosocket driver for OpenResty / ngx_lua. https://github.com/ledgetech/lua-resty-http/blob/master/LICENSE The BSD License (BSD 2-Clause License) https://opensource.org/licenses/BSD-2-Clause Copyright (c) 2013, James Hurst All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- jsonschema - Pure Lua JSON schema validator for Lua/LuaJIT. https://github.com/iresty/jsonschema/blob/devel/LICENSE The MIT License (MIT License) http://opensource.org/licenses/MIT Copyright (c) 2019 Yuansheng Wang membphis@gmail.com Copyright (c) 2017 Julien Desgats Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- luasocket - Network support for the Lua language. https://github.com/diegonehab/luasocket/blob/master/LICENSE The MIT License (MIT License) http://opensource.org/licenses/MIT Copyright © 2004-2013 Diego Nehab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- luafilesystem - LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution. https://github.com/keplerproject/luafilesystem/blob/master/LICENSE The MIT License (MIT License) http://opensource.org/licenses/MIT Copyright © 2003-2014 Kepler Project. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- lua-tinyyaml - a tiny yaml (subset) parser for pure lua. https://github.com/iresty/lua-tinyyaml/blob/dev/LICENSE https://github.com/peposso/lua-tinyyaml/blob/master/LICENSE The MIT License (MIT License) http://opensource.org/licenses/MIT Copyright (c) 2019 Yuansheng Wang membphis@gmail.com Copyright (c) 2017 peposso Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- multipart - Multipart Parser for Lua. https://github.com/Kong/lua-multipart/blob/master/LICENSE The MIT License (MIT License) http://opensource.org/licenses/MIT Copyright (c) 2015 Mashape (https://www.mashape.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- penlight - A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions,etc), and OS path management. Much of the functionality is inspired by the Python standard libraries. https://github.com/Tieske/Penlight/blob/master/LICENSE.md The MIT License (MIT License) http://opensource.org/licenses/MIT Copyright (C) 2009-2016 Steve Donovan, David Manura. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- lua-resty-mysql - This module is licensed under the BSD license. https://github.com/openresty/lua-resty-mysql#copyright-and-license The BSD License (BSD 2-Clause License) https://opensource.org/licenses/BSD-2-Clause Copyright (C) 2012-2018, by Yichun "agentzh" Zhang (章亦春) agentzh@gmail.com, OpenResty Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- lua-resty-lrucache - This module is licensed under the BSD license. https://github.com/openresty/lua-resty-lrucache#copyright-and-license The BSD License (BSD 2-Clause License) https://opensource.org/licenses/BSD-2-Clause Copyright (C) 2014-2019, by Yichun "agentzh" Zhang, OpenResty Inc. Copyright (C) 2014-2017, by Shuxin Yang. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

APIOAK 是基于 OpenResty 平台的高性能分布式API网关。 展开 收起
Lua
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Lua
1
https://gitee.com/tianku/apioak.git
git@gitee.com:tianku/apioak.git
tianku
apioak
apioak
master

搜索帮助