INNER CODE UNIT · Go
NewDito
andrearaponi/dito · app/app.go:27
func NewDito(transportConfig *config.HTTPTransportConfig, logger *slog.Logger) *Dito {
return &Dito{
Config: config.GetCurrentProxyConfig(),
Logger: logger,
TransportCache: transport.NewTransportCache(*transportConfig),
}
}
// UpdateConfig updates the configuration of the Dito application.
//
// Parameters:
// - newConfig: The new proxy configuration to apply.
func (d *Dito) UpdateConfig(newConfig *config.ProxyConfig) {
d.configMutex.Lock()
d.Config = newConfig
d.TransportCache.Clear()
d.configMutex.Unlock()
d.Logger.Warn("Configuration updated in Dito")