diff options
Diffstat (limited to 'go/internal/config/config.go')
-rw-r--r-- | go/internal/config/config.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/go/internal/config/config.go b/go/internal/config/config.go index 09fb62a..6085493 100644 --- a/go/internal/config/config.go +++ b/go/internal/config/config.go @@ -7,16 +7,14 @@ import ( "path" "path/filepath" "strings" - "time" yaml "gopkg.in/yaml.v2" ) const ( - configFile = "config.yml" - logFile = "gitlab-shell.log" - defaultSecretFileName = ".gitlab_shell_secret" - defaultReadTimeoutSeconds = 300 + configFile = "config.yml" + logFile = "gitlab-shell.log" + defaultSecretFileName = ".gitlab_shell_secret" ) type MigrationConfig struct { @@ -40,6 +38,7 @@ type Config struct { SecretFilePath string `yaml:"secret_file"` Secret string `yaml:"secret"` HttpSettings HttpSettingsConfig `yaml:"http_settings"` + HttpClient *HttpClient } func New() (*Config, error) { @@ -73,15 +72,6 @@ func (c *Config) FeatureEnabled(featureName string) bool { return false } -func (c *HttpSettingsConfig) ReadTimeout() time.Duration { - timeoutSeconds := c.ReadTimeoutSeconds - if c.ReadTimeoutSeconds == 0 { - timeoutSeconds = defaultReadTimeoutSeconds - } - - return time.Duration(timeoutSeconds) * time.Second -} - func newFromFile(filename string) (*Config, error) { cfg := &Config{RootDir: path.Dir(filename)} |