Closed hongbo-miao closed 2 years ago
Hello @Hongbo-Miao,
Thanks for your interest in Traefik!
Your error means that Yaegi cannot find the New
function of the traefik_plugin_disable_graphql_introspection
package.
Therefore, you can tell that Yaegi found your plugin, loaded it, but could not find the package. To fix this, you need to change the line package main
in your plugin's code, to package traefik_plugin_disable_graphql_introspection
.
As, it seems your issue might be a configuration problem, this issue will be closed. Feel free to join our Community Forum and reach out to us on the Traefik section to discuss this further.
Thanks @tomMoulard ! After changing package main
to package traefik_plugin_disable_graphql_introspection
, it works now! š
Originally asked at https://stackoverflow.com/questions/72178972/traefik-go-command-traefik-error-failed-to-eval-new-undefined-xxx
BTW, super love Traefik's idea using plugins and middlewares! š
I am trying to build a Traefik plugin and test it in local mode based on https://github.com/traefik/plugindemo#local-mode
Right now this plugin does nothing and just returns "Hello".
Here is my file structure:
In the
traefik/plugins-local/src/github.com/Hongbo-Miao/traefik-plugin-disable-graphql-introspection
folder, I have:.traefik.yml
go.mod
main.go
In the root folder, I have
traefik.yaml
dynamic_conf.yaml
I have a GraphQL sever running at http://localhost:5000
I want it go through Taefik and expose by http://localhost:9000
However, when I run
in the root folder, I got error
Traefik plugins are executed on the fly by Yaegi, an embedded Go interpreter.
The error seems threw by Yaegi, however, I have no clue how to debug.
Any guide would be appreciate!