Documentation ¶
Index ¶
- Constants
- func LoadEndpointFromEnv() string
- type Dialer
- type HttpNotOk
- type Resolver
- type RestClient
- func (client *RestClient) Do(req *http.Request) (*http.Response, error)
- func (client *RestClient) DoWithModel(req *http.Request, model interface{}) error
- func (client *RestClient) DoWithParseFunc(req *http.Request, parseFunc func(res *http.Response) error) error
- func (client *RestClient) DoWithParseRes(req *http.Request, parseFunc func(res *http.Response) error) error
- func (client *RestClient) DoXmlWithModel(method string, resource string, queryArgs url.Values, bodyModel interface{}, ...) error
- func (client *RestClient) DoXmlWithParseFunc(method string, resource string, queryArgs url.Values, ...) error
- func (client *RestClient) DoXmlWithParseRes(method string, resource string, queryArgs url.Values, ...) error
- func (client *RestClient) Endpoint() string
- func (client *RestClient) GetWithModel(resource string, queryArgs url.Values, model interface{}) error
- func (client *RestClient) GetWithParseFunc(resource string, queryArgs url.Values, ...) error
- func (client *RestClient) NewRequest(method, resource string, body io.Reader) (*http.Request, error)
- func (client *RestClient) NewRequestWithUrlQuery(method, resource string, body io.Reader, queryArgs url.Values) (*http.Request, error)
- func (client *RestClient) PutWithParseFunc(resource string, queryArgs url.Values, body io.Reader, ...) error
- func (client *RestClient) SetDefaultProject(projectName string)
- func (client *RestClient) SetUserAgent(userAgent string)
- func (client *RestClient) UserAgent() string
Constants ¶
View Source
const ( DefaultHttpTimeout = 5 DefaultTcpConnectionTimeout = 30 )
Todo 请求方法需要重构,加入header参数
View Source
const DefaultDNSCacheExpireTime = int64(600)
Variables ¶
This section is empty.
Functions ¶
func LoadEndpointFromEnv ¶
func LoadEndpointFromEnv() string
Types ¶
type HttpNotOk ¶
func NewHttpNotOk ¶
type Resolver ¶ added in v0.2.4
type Resolver struct { CacheTimeSeconds int64 // contains filtered or unexported fields }
func NewResolver ¶ added in v0.2.4
type RestClient ¶
type RestClient struct { account.Account // It is the total time from the tcp connection to http response. // the default value is 0, represents no timeout HttpTimeout time.Duration TcpConnectionTimeout time.Duration DnsCacheExpireTime time.Duration DisableCompression bool // contains filtered or unexported fields }
func NewOdpsRestClient ¶
func NewOdpsRestClient(a account.Account, endpoint string) RestClient
func (*RestClient) DoWithModel ¶
func (client *RestClient) DoWithModel(req *http.Request, model interface{}) error
func (*RestClient) DoWithParseFunc ¶
func (*RestClient) DoWithParseRes ¶
func (*RestClient) DoXmlWithModel ¶
func (*RestClient) DoXmlWithParseFunc ¶
func (*RestClient) DoXmlWithParseRes ¶
func (*RestClient) Endpoint ¶
func (client *RestClient) Endpoint() string
func (*RestClient) GetWithModel ¶
func (client *RestClient) GetWithModel(resource string, queryArgs url.Values, model interface{}) error
func (*RestClient) GetWithParseFunc ¶
func (*RestClient) NewRequest ¶
func (*RestClient) NewRequestWithUrlQuery ¶
func (*RestClient) PutWithParseFunc ¶
func (*RestClient) SetDefaultProject ¶
func (client *RestClient) SetDefaultProject(projectName string)
func (*RestClient) SetUserAgent ¶
func (client *RestClient) SetUserAgent(userAgent string)
func (*RestClient) UserAgent ¶
func (client *RestClient) UserAgent() string
Click to show internal directories.
Click to hide internal directories.