chore: move '/internal/pkg' to '/pkg'
This commit is contained in:
32
pkg/sdk3rd/cmcc/ecloudsdkcore@v1.0.0/configuration.go
Normal file
32
pkg/sdk3rd/cmcc/ecloudsdkcore@v1.0.0/configuration.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package ecloudsdkcore
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type APIKey struct {
|
||||
Key string
|
||||
Prefix string
|
||||
}
|
||||
|
||||
type Configuration struct {
|
||||
BasePath string `json:"basePath,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||
UserAgent string `json:"userAgent,omitempty"`
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
cfg := &Configuration{
|
||||
BasePath: "https://ecloud.10086.cn/",
|
||||
DefaultHeader: make(map[string]string),
|
||||
UserAgent: "Ecloud-SDK/1.0.0/go",
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
c.DefaultHeader[key] = value
|
||||
}
|
||||
Reference in New Issue
Block a user