@@ -19,11 +19,12 @@ type CLIConfig struct {
19
19
20
20
// Environment defines a format of environment configuration.
21
21
type 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"`
27
28
}
28
29
29
30
// Forwarding defines configuration for port forwarding.
@@ -44,9 +45,10 @@ func AddEnvironmentToConfig(c *cli.Context, cfg *CLIConfig, environmentID string
44
45
}
45
46
46
47
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 )),
50
52
Forwarding : Forwarding {
51
53
ServerURL : c .String (commands .FwServerURLKey ),
52
54
LocalPort : c .String (commands .FwLocalPortKey ),
@@ -93,6 +95,10 @@ func updateEnvironmentInConfig(c *cli.Context, cfg *CLIConfig, environmentID str
93
95
newEnvironment .Insecure = c .Bool (commands .InsecureKey )
94
96
}
95
97
98
+ if c .IsSet (commands .RequestTimeoutKey ) {
99
+ newEnvironment .RequestTimeout = Duration (c .Duration (commands .RequestTimeoutKey ))
100
+ }
101
+
96
102
if c .IsSet (commands .FwServerURLKey ) {
97
103
newEnvironment .Forwarding .ServerURL = c .String (commands .FwServerURLKey )
98
104
}
0 commit comments