2018-03-01 07:10:04 +00:00
|
|
|
package cmd
|
2017-08-25 14:10:03 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2019-08-03 01:58:23 +00:00
|
|
|
"github.com/containous/traefik/v2/pkg/config/static"
|
|
|
|
"github.com/containous/traefik/v2/pkg/types"
|
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{
|
2019-06-17 09:48:05 +00:00
|
|
|
ProvidersThrottleDuration: types.Duration(2 * time.Second),
|
2018-11-27 16:42:04 +00:00
|
|
|
},
|
|
|
|
ServersTransport: &static.ServersTransport{
|
|
|
|
MaxIdleConnsPerHost: 200,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ConfigFile: "",
|
|
|
|
}
|
2017-08-25 14:10:03 +00:00
|
|
|
}
|