MCPcopy Index your code
hub / github.com/ContentSquare/chproxy / applyConfig

Function applyConfig

main.go:301–317  ·  view source on GitHub ↗
(cfg *config.Config)

Source from the content-addressed store, hash-verified

299}
300
301func applyConfig(cfg *config.Config) error {
302 if proxy == nil || proxyConfigChanged(&cfg.ConnectionPool, proxy) {
303 proxy = newReverseProxy(&cfg.ConnectionPool)
304 }
305 if err := proxy.applyConfig(cfg); err != nil {
306 return err
307 }
308 allowedNetworksHTTP.Store(&cfg.Server.HTTP.AllowedNetworks)
309 allowedNetworksHTTPS.Store(&cfg.Server.HTTPS.AllowedNetworks)
310 allowedNetworksMetrics.Store(&cfg.Server.Metrics.AllowedNetworks)
311 proxyHandler.Store(NewProxyHandler(&cfg.Server.Proxy))
312 allowPing.Store(cfg.AllowPing)
313 log.SetDebug(cfg.LogDebug)
314 log.Infof("Loaded config:\n%s", cfg)
315
316 return nil
317}
318
319func reloadConfig() error {
320 cfg, err := loadConfig()

Callers 4

startTLSFunction · 0.85
startHTTPFunction · 0.85
mainFunction · 0.85
reloadConfigFunction · 0.85

Calls 7

SetDebugFunction · 0.92
InfofFunction · 0.92
proxyConfigChangedFunction · 0.85
newReverseProxyFunction · 0.85
NewProxyHandlerFunction · 0.85
applyConfigMethod · 0.80
StoreMethod · 0.80

Tested by 2

startTLSFunction · 0.68
startHTTPFunction · 0.68