apisix/t/stream-plugin
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
..
mqtt-proxy.t refactory: collect upstream logic and put them in a single file. (#1734) 2020-06-22 14:21:42 +08:00