apisix-go-plugin-runner
apisix-go-plugin-runner copied to clipboard
request help: control API for go plugin
Issue description
What should I do if I want to use the control API in the go plugin? Or is there any other solution to achieve similar functions
Environment
- APISIX Go Plugin Runner's version:0.3.0
- APISIX version: 2.14
- Go version: 1.15
- OS (cmd:
uname -a
): linux
I can't get your point, do you want to register control api in go runner? Can you describe your use case in detail?
我在apisix新增了一个自定义的go插件, 我希望这个插件能提供一个对内的api,从而让我的内部脚本可以通过http请求的方式调用,来触发插件内的一些缓存更新的逻辑。 比如, 我的go plugin内有一个全局变量 a int 缓存了一个值为 1 我期望,我能在go plugin内开一个接口, 当此接口被调用,go plugin内的全局变量a 的值变为2
You can start an http service in your own go-runner, expose your API, and then create a route in APISIX to protect your API interface.
I need this feature too ;-)
IMO, though exposing a new http service in the go-runner is a feasible solution, I do think that the APISIX control API is somewhere more suitable.
Do you mean that the control api in APISIX can also take effect in go runner, or use golang alone to support control api in go runner?
I mean, to register control api like what we can did in lua: https://apisix.apache.org/docs/apisix/plugin-develop/#register-control-api Maybe we should add another RPC event for this purpose.
If we decide to implement this feature, IMO, we should support it in every language that APISIX supports: go, python and java. Not only golang
I mean, to register control api like what we can did in lua: https://apisix.apache.org/docs/apisix/plugin-develop/#register-control-api Maybe we should add another RPC event for this purpose.
If it is to implement the same feature as in Lua, it seems that it can only be supported in go-plugin-runner, and it is not necessary to add an RPC event to interact with APISIX.