Migrated repository
Go to file
2019-05-23 14:42:42 +08:00
conf feature: implemented plugin limit-count. 2019-05-21 11:17:46 +08:00
doc change: fetched all of the config from apisix.core.config. 2019-05-22 09:19:25 +08:00
lua change: used response which is a fully name. 2019-05-23 14:42:42 +08:00
t change: used response which is a fully name. 2019-05-23 14:42:42 +08:00
.gitignore change: added doc of how to load plugin. (#1) 2019-05-06 10:14:39 +08:00
COPYRIGHT change: upadated COPYRIGHT file. 2019-04-11 16:58:32 +08:00
LICENSE feature: supported to load config from YAML config. 2019-04-11 16:53:21 +08:00
Makefile change: rename the project to apisix. 2019-05-13 14:31:26 +08:00
README.md change: code style. 2019-05-20 12:06:34 +08:00

Summary

Design Doc

How to load the plugin?

Plugin

Development

Source Install

Dependent library

Install by luarocks

luarocks install lua-resty-r3 lua-resty-mlcache lua-resty-etcd lua-resty-balancer

User routes with plugins config in etcd

Here is example for one route and one upstream:

$ curl http://127.0.0.1:2379/v2/keys/user_routes/1 | python -m json.tool
{
    "action": "get",
    "node": {
        "createdIndex": 649,
        "key": "/user_routes/1",
        "modifiedIndex": 649,
        "value": "{\"host\":\"test.com\",\"methods\":[\"GET\"],\"uri\":\"/hello\",\"id\":3333,\"plugin_config\":{\"example-plugin\":{\"i\":1,\"s\":\"s\",\"t\":[1,2]},\"new-plugin\":{\"a\":\"a\"}},\"upstream\":{\"id\":1,\"type\":\"roundrobin\"}}"
    }
}

$ curl http://127.0.0.1:2379/v2/keys/user_upstreams/1 | python -m json.tool
{
    "action": "get",
    "node": {
        "createdIndex": 679,
        "key": "/user_upstreams/1",
        "modifiedIndex": 679,
        "value": "{\"id\":1,\"type\":\"roundrobin\",\"nodes\":{\"220.181.57.215:80\":1,\"220.181.57.216:80\":1,\"220.181.57.217:80\":1}}"
    }
}

Here is example for one route (it contains the upstream information):

$ curl http://127.0.0.1:2379/v2/keys/user_routes/1 | python -m json.tool
{
    "action": "get",
    "node": {
        "createdIndex": 649,
        "key": "/user_routes/1",
        "modifiedIndex": 649,
        "value": "{\"host\":\"test.com\",\"methods\":[\"GET\"],\"uri\":\"/hello\",\"id\":3333,\"plugin_config\":{\"example-plugin\":{\"i\":1,\"s\":\"s\",\"t\":[1,2]},\"new-plugin\":{\"a\":\"a\"}},\"upstream\":{\"type\":\"roundrobin\",\"nodes\":{\"220.181.57.215:80\":1,\"220.181.57.216:80\":1,\"220.181.57.217:80\":1}}}"
    }
}