Documentation ¶
Index ¶
- Variables
- func CallRet(ctx context.Context, ret interface{}, resp *http.Response) (err error)
- func ResponseError(resp *http.Response) (err error)
- func TurnOnDebug()
- type Client
- func (r Client) Call(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) CallWithJSONQuery(ctx context.Context, ret interface{}, method, reqURL string, ...) (err 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) DoRequestQueryWithJSON(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) 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 ¶
This section is empty.
Variables ¶
View Source
var DebugMode = true
DebugMode 用来打印调试信息
View Source
var DeepDebugInfo = true
DeepDebugInfo 深度打印
View Source
var DefaultClient = Client{&http.Client{Transport: http.DefaultTransport}}
DefaultClient Default client
View Source
var UserAgent = "Golang danghongyun/client package"
UserAgent agent
Functions ¶
Types ¶
type Client ¶
Client 负责发送HTTP请求到七牛接口服务器
func (Client) Call ¶
func (r Client) Call(ctx context.Context, ret interface{}, method, reqURL string, headers http.Header) (err error)
Call get call
func (Client) CallWithForm ¶
func (r Client) CallWithForm(ctx context.Context, ret interface{}, method, reqURL string, headers http.Header, param map[string][]string) (err error)
CallWithForm do requeset
func (Client) CallWithJSON ¶
func (r Client) CallWithJSON(ctx context.Context, ret interface{}, method, reqURL string, headers http.Header, param interface{}) (err error)
CallWithJSON api call
func (Client) CallWithJSONQuery ¶
func (r Client) CallWithJSONQuery(ctx context.Context, ret interface{}, method, reqURL string, headers http.Header, param map[string][]string) (err error)
CallWithJSONQuery api call
func (Client) DoRequest ¶
func (r Client) DoRequest(ctx context.Context, method, reqURL string, headers http.Header) (resp *http.Response, err error)
DoRequest do request
func (Client) DoRequestQueryWithJSON ¶
func (r Client) DoRequestQueryWithJSON(ctx context.Context, method, reqURL string, headers http.Header, data map[string][]string) (resp *http.Response, err error)
DoRequestQueryWithJSON request
func (Client) DoRequestWith ¶
func (r Client) DoRequestWith(ctx context.Context, method, reqURL string, headers http.Header, body io.Reader, bodyLength int) (resp *http.Response, err error)
DoRequestWith request
func (Client) DoRequestWith64 ¶
func (r Client) DoRequestWith64(ctx context.Context, method, reqURL string, headers http.Header, body io.Reader, bodyLength int64) (resp *http.Response, err error)
DoRequestWith64 request
Click to show internal directories.
Click to hide internal directories.