第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

traefik.go:命令 traefik 錯誤:無法評估新:未定義:xxx

traefik.go:命令 traefik 錯誤:無法評估新:未定義:xxx

Go
蝴蝶刀刀 2022-12-13 10:44:41
我正在嘗試構(gòu)建一個 Traefik 插件并基于https://github.com/traefik/plugindemo#local-mode在本地模式下對其進行測試現(xiàn)在這個插件什么都不做,只返回“Hello”。這是我的文件結(jié)構(gòu):在traefik/plugins-local/src/github.com/Hongbo-Miao/traefik-plugin-disable-graphql-introspection文件夾中,我有:.traefik.ymlentryPoints:  graphql-server-entrypoint:    address: :9000api:  insecure: true  dashboard: trueproviders:  file:    filename: dynamic_conf.yamllog:  level: DEBUGexperimental:  localPlugins:    traefik-plugin-disable-graphql-introspection:      modulename: github.com/Hongbo-Miao/traefik-plugin-disable-graphql-introspectiongo.modmodule github.com/Hongbo-Miao/traefik-plugin-disable-graphql-introspectiongo 1.17主程序package mainimport (    "context"    "net/http")type Config struct{}func CreateConfig() *Config {    return &Config{}}type DisableGraphQLIntrospection struct {    next http.Handler    name string}func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {    return &DisableGraphQLIntrospection{        next: next,        name: name,    }, nil}func (a *DisableGraphQLIntrospection) ServeHTTP(rw http.ResponseWriter, req *http.Request) {    rw.Write([]byte("hello"))}在根文件夾中,我有traefik.yamlentryPoints:  graphql-server-entrypoint:    address: :9000api:  insecure: true  dashboard: trueproviders:  file:    filename: dynamic_conf.yamllog:  level: DEBUGexperimental:  localPlugins:    traefik-plugin-disable-graphql-introspection:      modulename: github.com/Hongbo-Miao/traefik-plugin-disable-graphql-introspection
查看完整描述

1 回答

?
繁星點點滴滴

TA貢獻1803條經(jīng)驗 獲得超3個贊

得到了 Tom Moulard 的答復(fù),謝謝!https://github.com/traefik/plugindemo/issues/15#issuecomment-1123741949

你的錯誤是八重木找不到包New的功能traefik_plugin_disable_graphql_introspection。因此,您可以判斷 Yaegi 找到了您的插件并加載了它,但找不到包。package main要解決此問題,您需要將插件代碼中的行更改為package traefik_plugin_disable_graphql_introspection.

main.go文件中更改為后package main,它現(xiàn)在可以工作了!package traefik_plugin_disable_graphql_introspection


查看完整回答
反對 回復(fù) 2022-12-13
  • 1 回答
  • 0 關(guān)注
  • 138 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號