Shared API library
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
472 B

  1. package as
  2. import (
  3. "net/http"
  4. "time"
  5. )
  6. // defaultHTTPTimeout is the default http.Client timeout.
  7. const defaultHTTPTimeout = 10 * time.Second
  8. // ClientConfig contains API configuration
  9. type ClientConfig struct {
  10. // BaseURL of the API we're talking to
  11. BaseURL string
  12. // Client making requests to the API
  13. Client *http.Client
  14. }
  15. func NewClientConfig() *ClientConfig {
  16. return &ClientConfig{
  17. BaseURL: "",
  18. Client: &http.Client{Timeout: defaultHTTPTimeout},
  19. }
  20. }