2023-02-21 20:46:05 +08:00
|
|
|
package sdk
|
|
|
|
|
|
|
|
import (
|
2023-02-21 20:58:53 +08:00
|
|
|
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
2023-02-21 20:46:05 +08:00
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
Debug bool `default:"false"`
|
|
|
|
HttpTransport *http.Transport `default:""`
|
|
|
|
Transport http.RoundTripper `default:""`
|
|
|
|
GoRoutinePoolSize int `default:"0"`
|
|
|
|
UserAgent string `default:""`
|
|
|
|
Scheme string `default:"HTTP"`
|
|
|
|
Timeout time.Duration `default:"5"`
|
|
|
|
Env string `default:""`
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewConfig() *Config {
|
|
|
|
config := &Config{}
|
|
|
|
utils.InitStructWithDefaultTag(config)
|
|
|
|
return config
|
|
|
|
}
|