如果你想使用 client-go 与 Clusternet 交互,你只需要在你的代码中插入下面的 wrapperFunc
,其余的保持不变。
// 只需添加如下代码
config.Wrap(func(rt http.RoundTripper) http.RoundTripper {
return clientgo.NewClusternetTransport(config.Host, rt)
})
您可以查阅 demo.go 以快速入门。
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.