diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2019-04-23 14:07:38 +0300 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2019-04-23 14:23:31 +0300 |
commit | fbaba66e124441d0e283fd4e2966d7af790ce23a (patch) | |
tree | b7560b534f9290b4f9b341f956c22d10d7db95dc /go/internal/config/config.go | |
parent | 9ed567b6fd14ef389df11b46be3022a90eda68ec (diff) | |
download | gitlab-shell-id-api-regular-http.tar.gz |
Move http client building to configid-api-regular-http
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)} |