UDP support
Co-authored-by: Julien Salleyron <julien.salleyron@gmail.com>
This commit is contained in:
parent
8988c8f9af
commit
115d42e0f0
72 changed files with 4730 additions and 321 deletions
|
@ -219,6 +219,10 @@ func (p *Provider) loadFileConfigFromDirectory(ctx context.Context, directory st
|
|||
Stores: make(map[string]tls.Store),
|
||||
Options: make(map[string]tls.Options),
|
||||
},
|
||||
UDP: &dynamic.UDPConfiguration{
|
||||
Routers: make(map[string]*dynamic.UDPRouter),
|
||||
Services: make(map[string]*dynamic.UDPService),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,6 +292,22 @@ func (p *Provider) loadFileConfigFromDirectory(ctx context.Context, directory st
|
|||
}
|
||||
}
|
||||
|
||||
for name, conf := range c.UDP.Routers {
|
||||
if _, exists := configuration.UDP.Routers[name]; exists {
|
||||
logger.WithField(log.RouterName, name).Warn("UDP router already configured, skipping")
|
||||
} else {
|
||||
configuration.UDP.Routers[name] = conf
|
||||
}
|
||||
}
|
||||
|
||||
for name, conf := range c.UDP.Services {
|
||||
if _, exists := configuration.UDP.Services[name]; exists {
|
||||
logger.WithField(log.ServiceName, name).Warn("UDP service already configured, skipping")
|
||||
} else {
|
||||
configuration.UDP.Services[name] = conf
|
||||
}
|
||||
}
|
||||
|
||||
for _, conf := range c.TLS.Certificates {
|
||||
if _, exists := configTLSMaps[conf]; exists {
|
||||
logger.Warnf("TLS configuration %v already configured, skipping", conf)
|
||||
|
@ -392,6 +412,10 @@ func (p *Provider) decodeConfiguration(filePath string, content string) (*dynami
|
|||
Stores: make(map[string]tls.Store),
|
||||
Options: make(map[string]tls.Options),
|
||||
},
|
||||
UDP: &dynamic.UDPConfiguration{
|
||||
Routers: make(map[string]*dynamic.UDPRouter),
|
||||
Services: make(map[string]*dynamic.UDPService),
|
||||
},
|
||||
}
|
||||
|
||||
switch strings.ToLower(filepath.Ext(filePath)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue