Documentation ¶
Index ¶
- Constants
- Variables
- func AddHttpHeaderRange(header http.Header, contentRange string)
- func CallRet(ctx context.Context, ret interface{}, resp *http.Response) (err error)
- func DecodeJsonFromReader(reader io.Reader, v interface{}) error
- func ResponseError(resp *http.Response) error
- func SetAppName(userApp string) error
- func TurnOnDebug()
- func WithDialTimeout(ctx context.Context, timeout time.Duration) context.Context
- func WithKeepAliveInterval(ctx context.Context, interval time.Duration) context.Context
- func WithResolvedIPs(ctx context.Context, domain string, ips []net.IP) context.Context
- type Client
- func (r Client) Call(ctx context.Context, ret interface{}, method, reqUrl string, ...) (err error)
- func (r Client) CallWith(ctx context.Context, ret interface{}, method, reqUrl string, ...) (err error)
- func (r Client) CallWith64(ctx context.Context, ret interface{}, method, reqUrl string, ...) (err error)
- func (r Client) CallWithBodyGetter(ctx context.Context, ret interface{}, method, reqUrl string, ...) (err error)
- func (r Client) CallWithForm(ctx context.Context, ret interface{}, method, reqUrl string, ...) (err error)
- func (r Client) CallWithJson(ctx context.Context, ret interface{}, method, reqUrl string, ...) (err error)
- func (r Client) CredentialedCall(ctx context.Context, cred *auth.Credentials, tokenType auth.TokenType, ...) error
- func (r Client) CredentialedCallWith(ctx context.Context, cred *auth.Credentials, tokenType auth.TokenType, ...) error
- func (r Client) CredentialedCallWith64(ctx context.Context, cred *auth.Credentials, tokenType auth.TokenType, ...) error
- func (r Client) CredentialedCallWithForm(ctx context.Context, cred *auth.Credentials, tokenType auth.TokenType, ...) error
- func (r Client) CredentialedCallWithJson(ctx context.Context, cred *auth.Credentials, tokenType auth.TokenType, ...) error
- func (r Client) Do(ctx context.Context, req *http.Request) (resp *http.Response, err error)
- func (r Client) DoRequest(ctx context.Context, method, reqUrl string, headers http.Header) (resp *http.Response, err error)
- func (r Client) DoRequestWith(ctx context.Context, method, reqUrl string, headers http.Header, ...) (resp *http.Response, err error)
- func (r Client) DoRequestWith64(ctx context.Context, method, reqUrl string, headers http.Header, ...) (resp *http.Response, err error)
- func (r Client) DoRequestWithBodyGetter(ctx context.Context, method, reqUrl string, headers http.Header, ...) (resp *http.Response, err error)
- func (r Client) DoRequestWithForm(ctx context.Context, method, reqUrl string, headers http.Header, ...) (resp *http.Response, err error)
- func (r Client) DoRequestWithJson(ctx context.Context, method, reqUrl string, headers http.Header, ...) (resp *http.Response, err error)
- type ErrorInfo
Constants ¶
View Source
const (
RequestHeaderKeyXQiniuDate = "X-Qiniu-Date"
)
Variables ¶
View Source
var ( UserAgent = getUserAgentWithAppName("default") DefaultClient = Client{&http.Client{Transport: DefaultTransport}} // 用来打印调试信息 DebugMode = false DeepDebugInfo = false )
View Source
var DefaultTransport http.RoundTripper = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: defaultDialFunc, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }
Functions ¶
func AddHttpHeaderRange ¶ added in v7.18.0
func DecodeJsonFromReader ¶ added in v7.17.0
func ResponseError ¶
func WithDialTimeout ¶ added in v7.21.0
func WithKeepAliveInterval ¶ added in v7.21.0
Types ¶
type Client ¶
Client 负责发送HTTP请求到七牛接口服务器
func (Client) CallWith64 ¶
func (Client) CallWithBodyGetter ¶ added in v7.9.7
func (Client) CallWithForm ¶
func (Client) CallWithJson ¶
func (Client) CredentialedCall ¶
func (Client) CredentialedCallWith ¶
func (Client) CredentialedCallWith64 ¶
func (Client) CredentialedCallWithForm ¶
func (Client) CredentialedCallWithJson ¶
func (Client) DoRequestWith ¶
func (Client) DoRequestWith64 ¶
func (Client) DoRequestWithBodyGetter ¶ added in v7.9.7
func (Client) DoRequestWithForm ¶
Click to show internal directories.
Click to hide internal directories.