mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-21 06:19:09 -04:00
remove mapstructure from config directives
This commit is contained in:
@@ -38,15 +38,15 @@ type Asset struct {
|
||||
|
||||
// Policy enables us to use multiple directors.
|
||||
type Policy struct {
|
||||
Name string `mapstructure:"name"`
|
||||
Routes []Route `mapstructure:"routes"`
|
||||
Name string
|
||||
Routes []Route
|
||||
}
|
||||
|
||||
// Route define forwarding routes
|
||||
type Route struct {
|
||||
Endpoint string `mapstructure:"endpoint"`
|
||||
Backend string `mapstructure:"backend"`
|
||||
ApacheVHost bool `mapstructure:"apache-vhost"`
|
||||
Endpoint string
|
||||
Backend string
|
||||
ApacheVHost bool `mapstructure:"apache-vhost"`
|
||||
}
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
@@ -57,7 +57,7 @@ type Config struct {
|
||||
HTTP HTTP
|
||||
Tracing Tracing
|
||||
Asset Asset
|
||||
Policies []Policy `mapstructure:"policies"`
|
||||
Policies []Policy
|
||||
}
|
||||
|
||||
// New initializes a new configuration
|
||||
|
||||
@@ -26,6 +26,10 @@ func NewMultiHostReverseProxy(opts ...Option) *MultiHostReverseProxy {
|
||||
logger: options.Logger,
|
||||
}
|
||||
|
||||
if options.Config.Policies == nil {
|
||||
reverseProxy.logger.Debug().Msg("config file not provided")
|
||||
}
|
||||
|
||||
for _, policy := range options.Config.Policies {
|
||||
for _, route := range policy.Routes {
|
||||
reverseProxy.logger.Debug().Str("fwd: ", route.Endpoint)
|
||||
|
||||
Reference in New Issue
Block a user