Commit Graph

9 Commits

Author SHA1 Message Date
YuanSheng Wang
ee7533874d
optimize: Use lru to avoid resolving IP addresses repeatedly . (#1772)
* optimize: Use lru to avoid resolving IP addresses repeatedly .
Cached the global rules to `ctx` .

* optimzie: used a longer time interval for etcd and flush access log.

* optimize: return upstream node directly if the count is 1 .

* optimize: avoid to cache useless variable.
2020-06-28 18:14:38 +08:00
YuanSheng Wang
748e33756b
refactory: collect upstream logic and put them in a single file. (#1734)
feature: support dynamic upstream in plugin.

here is a mini  example in `access` phase of plugin:

```lua
    local up_conf = {
        type = "roundrobin",
        nodes = {
            {host = conf.upstream.ip, port = conf.upstream.port, weight = 1},
        }
    }

    local ok, err = upstream.check_schema(up_conf)
    if not ok then
        return 500, err
    end

    local matched_route = ctx.matched_route
    upstream.set(ctx, up_conf.type .. "#route_" .. matched_route.value.id,
                 ctx.conf_version, up_conf, matched_route)
    return
```
2020-06-22 14:21:42 +08:00
qiujiayu
e7d19ec160
feature: support discovery center (#1440) 2020-05-14 23:20:44 +08:00
WenMing
12a2b01b71
license: add ASF header. (#743) 2019-10-31 09:27:28 +08:00
YuanSheng Wang
4aaaf3ee5a
feature: support dynamic stream(TCP/UDP) proxy in apisix. (#501)
* feature: support stream in apisix.
* doc: added new feature in README.
* CLI and added more doc.
2019-09-12 13:27:18 +08:00
Yuansheng
4bb40df857 change(test): name style. 2019-09-10 10:07:29 +08:00
Yuansheng
9513e3d37c change: moved service and ssl source file to http folder. 2019-07-12 10:40:45 +08:00
YuanSheng Wang
85f420977c change: added prefix http_ for http request. (#179) 2019-07-01 17:24:38 +08:00
YuanSheng Wang
c02d44f8e7
feature: added test cases about round-robin load balance algorithms. (#123)
* feature: added test cases about round-robin load balance algorithms.

* feature: added test cases about consistent hash algorithms.
2019-06-17 23:17:41 +08:00