Browse Source

complete configs

Signed-off-by: 高汝彤 <rutong.grt@alibaba-inc.com>
高汝彤 8 years ago
parent
commit
079e0a218a
1 changed files with 35 additions and 0 deletions
  1. 35 0
      sdk/config.go

+ 35 - 0
sdk/config.go

@@ -43,6 +43,41 @@ func (c *Config) WithTimeout(timeout time.Duration) *Config {
 	return c
 }
 
+func (c *Config) WithAutoRetry(isAutoRetry bool) *Config {
+	c.AutoRetry = isAutoRetry
+	return c
+}
+
+func (c *Config) WithMaxRetryTime(maxRetryTime int) *Config {
+	c.MaxRetryTime = maxRetryTime
+	return c
+}
+
+func (c *Config) WithUserAgent(userAgent string) *Config {
+	c.UserAgent = userAgent
+	return c
+}
+
+func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config {
+	c.HttpTransport = httpTransport
+	return c
+}
+
+func (c *Config) WithEnableAsync(isEnableAsync bool) *Config {
+	c.EnableAsync = isEnableAsync
+	return c
+}
+
+func (c *Config) WithMaxTaskQueueSize(maxTaskQueueSize int) *Config {
+	c.MaxTaskQueueSize = maxTaskQueueSize
+	return c
+}
+
+func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config {
+	c.GoRoutinePoolSize = goRoutinePoolSize
+	return c
+}
+
 func (c *Config) WithDebug(isDebug bool) *Config {
 	c.Debug = isDebug
 	return c