This commit is contained in:
2023-06-01 16:50:10 +03:00
parent 2a1593f45f
commit c9e4ae6afe
11 changed files with 107 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ package config
import (
"encoding/json"
"os"
"time"
"gopkg.in/yaml.v3"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
@@ -44,6 +45,15 @@ type Config struct {
// Skip verify, true by default
// Required: false
SSLSkipVerify bool `json:"sslSkipVerify" yaml:"sslSkipVerify"`
// HTTP client timeout, unlimited if left empty
// Required: false
Timeout Duration `json:"timeout" yaml:"timeout"`
}
// SetTimeout is used to set HTTP client timeout.
func (c *Config) SetTimeout(dur time.Duration) {
c.Timeout = Duration(dur)
}
// ParseConfigJSON parses Config from specified JSON-formatted file.