config.go 744 B

12345678910111213141516171819202122232425262728293031
  1. package tos
  2. import "time"
  3. type Config struct {
  4. Endpoint string
  5. Region string
  6. TransportConfig TransportConfig
  7. }
  8. func defaultConfig() Config {
  9. return Config{
  10. TransportConfig: DefaultTransportConfig(),
  11. }
  12. }
  13. func DefaultTransportConfig() TransportConfig {
  14. return TransportConfig{
  15. MaxIdleConns: 1024,
  16. MaxIdleConnsPerHost: 1024,
  17. MaxConnsPerHost: 1024,
  18. DialTimeout: 10 * time.Second,
  19. KeepAlive: 30 * time.Second,
  20. IdleConnTimeout: 60 * time.Second,
  21. TLSHandshakeTimeout: 10 * time.Second,
  22. ResponseHeaderTimeout: 60 * time.Second,
  23. ExpectContinueTimeout: 3 * time.Second,
  24. ReadTimeout: 30 * time.Second,
  25. WriteTimeout: 30 * time.Second,
  26. }
  27. }