@@ -19,11 +19,12 @@ type CLIConfig struct {
1919
2020// Environment defines a format of environment configuration.
2121type Environment struct {
22- EnvironmentID string `yaml:"-" json:"environment_id"`
23- URL string `yaml:"url" json:"url"`
24- Token string `yaml:"token" json:"token"`
25- Insecure bool `yaml:"insecure" json:"insecure"`
26- Forwarding Forwarding `yaml:"forwarding" json:"forwarding"`
22+ EnvironmentID string `yaml:"-" json:"environment_id"`
23+ URL string `yaml:"url" json:"url"`
24+ Token string `yaml:"token" json:"token"`
25+ Insecure bool `yaml:"insecure" json:"insecure"`
26+ RequestTimeout Duration `yaml:"request_timeout,omitempty" json:"request_timeout,omitempty"`
27+ Forwarding Forwarding `yaml:"forwarding" json:"forwarding"`
2728}
2829
2930// Forwarding defines configuration for port forwarding.
@@ -44,9 +45,10 @@ func AddEnvironmentToConfig(c *cli.Context, cfg *CLIConfig, environmentID string
4445 }
4546
4647 env := Environment {
47- URL : c .String (commands .URLKey ),
48- Token : c .String (commands .TokenKey ),
49- Insecure : c .Bool (commands .InsecureKey ),
48+ URL : c .String (commands .URLKey ),
49+ Token : c .String (commands .TokenKey ),
50+ Insecure : c .Bool (commands .InsecureKey ),
51+ RequestTimeout : Duration (c .Duration (commands .RequestTimeoutKey )),
5052 Forwarding : Forwarding {
5153 ServerURL : c .String (commands .FwServerURLKey ),
5254 LocalPort : c .String (commands .FwLocalPortKey ),
@@ -93,6 +95,10 @@ func updateEnvironmentInConfig(c *cli.Context, cfg *CLIConfig, environmentID str
9395 newEnvironment .Insecure = c .Bool (commands .InsecureKey )
9496 }
9597
98+ if c .IsSet (commands .RequestTimeoutKey ) {
99+ newEnvironment .RequestTimeout = Duration (c .Duration (commands .RequestTimeoutKey ))
100+ }
101+
96102 if c .IsSet (commands .FwServerURLKey ) {
97103 newEnvironment .Forwarding .ServerURL = c .String (commands .FwServerURLKey )
98104 }
0 commit comments