2018-03-01 07:10:04 +00:00
|
|
|
package cmd
|
2017-08-25 14:10:03 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2020-08-17 16:04:03 +00:00
|
|
|
ptypes "github.com/traefik/paerser/types"
|
2020-09-16 13:46:04 +00:00
|
|
|
"github.com/traefik/traefik/v2/pkg/config/static"
|
2017-08-25 14:10:03 +00:00
|
|
|
)
|
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
// TraefikCmdConfiguration wraps the static configuration and extra parameters.
|
|
|
|
type TraefikCmdConfiguration struct {
|
|
|
|
static.Configuration `export:"true"`
|
|
|
|
// ConfigFile is the path to the configuration file.
|
|
|
|
ConfigFile string `description:"Configuration file to use. If specified all other flags are ignored." export:"true"`
|
2018-11-27 16:42:04 +00:00
|
|
|
}
|
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
// NewTraefikConfiguration creates a TraefikCmdConfiguration with default values.
|
|
|
|
func NewTraefikConfiguration() *TraefikCmdConfiguration {
|
|
|
|
return &TraefikCmdConfiguration{
|
2018-11-27 16:42:04 +00:00
|
|
|
Configuration: static.Configuration{
|
|
|
|
Global: &static.Global{
|
2019-03-14 18:32:03 +00:00
|
|
|
CheckNewVersion: true,
|
2018-11-27 16:42:04 +00:00
|
|
|
},
|
|
|
|
EntryPoints: make(static.EntryPoints),
|
|
|
|
Providers: &static.Providers{
|
2020-08-17 16:04:03 +00:00
|
|
|
ProvidersThrottleDuration: ptypes.Duration(2 * time.Second),
|
2018-11-27 16:42:04 +00:00
|
|
|
},
|
|
|
|
ServersTransport: &static.ServersTransport{
|
|
|
|
MaxIdleConnsPerHost: 200,
|
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
TCPServersTransport: &static.TCPServersTransport{
|
|
|
|
DialTimeout: ptypes.Duration(30 * time.Second),
|
|
|
|
DialKeepAlive: ptypes.Duration(15 * time.Second),
|
|
|
|
},
|
2018-11-27 16:42:04 +00:00
|
|
|
},
|
|
|
|
ConfigFile: "",
|
|
|
|
}
|
2017-08-25 14:10:03 +00:00
|
|
|
}
|