config.go 845 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package nodestats
  2. import (
  3. "net/http"
  4. )
  5. type NodeClientProxyConfig struct {
  6. ForceKubeProxy bool
  7. LocalProxy string
  8. }
  9. func (nac NodeClientProxyConfig) IsLocalProxy() bool {
  10. return nac.LocalProxy != ""
  11. }
  12. type NodeClientConfig struct {
  13. ClusterId string
  14. ConcurrentPollers int
  15. Transport *http.Transport
  16. CertFile string
  17. KeyFile string
  18. ProxyConfig NodeClientProxyConfig
  19. }
  20. func NewNodeClientConfig(
  21. clusterId string,
  22. concurrentPollers int,
  23. transport *http.Transport,
  24. certFile string,
  25. keyFile string,
  26. proxyConfig NodeClientProxyConfig,
  27. ) *NodeClientConfig {
  28. return &NodeClientConfig{
  29. ClusterId: clusterId,
  30. ConcurrentPollers: concurrentPollers,
  31. Transport: transport,
  32. CertFile: certFile,
  33. KeyFile: keyFile,
  34. ProxyConfig: proxyConfig,
  35. }
  36. }