Documentation
¶
Index ¶
- func Convert2LogString(object interface{}) string
- func LogRpcJson(ctx context.Context, business string, method string, params interface{}, ...)
- func ReadHttpResp(result *http.Response) (body []byte, err error)
- func SendRequest(ctx context.Context, client *http.Client, httpRequestParams *HttpRequestParams, ...) (result []byte, err error)
- func SendRequestOriResp(ctx context.Context, client *http.Client, httpRequestParams *HttpRequestParams, ...) (result *http.Response, err error)
- type HttpClient
- func (c HttpClient) Delete(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
- func (c HttpClient) Get(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
- func (c HttpClient) PostFile(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
- func (c HttpClient) PostForm(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
- func (c HttpClient) PostJson(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
- func (c HttpClient) PostJsonOriResp(ctx context.Context, httpRequestParams *HttpRequestParams) (result *http.Response, err error)
- type HttpRequestFileParams
- type HttpRequestParams
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert2LogString ¶
func Convert2LogString(object interface{}) string
func LogRpcJson ¶
func ReadHttpResp ¶ added in v0.2.5
func SendRequest ¶
func SendRequest(ctx context.Context, client *http.Client, httpRequestParams *HttpRequestParams, requestType string, buildRequest func(*HttpRequestParams, context.Context) (*http.Request, string, error)) (result []byte, err error)
SendRequest 此方法实现的目的是作为一个通用的http调用方法,也是最核心http调用
func SendRequestOriResp ¶
func SendRequestOriResp(ctx context.Context, client *http.Client, httpRequestParams *HttpRequestParams, requestType string, buildRequest func(*HttpRequestParams, context.Context) (*http.Request, string, error)) (result *http.Response, err error)
SendRequestOriResp 此方法实现的目的是作为一个通用的http调用方法,也是最核心http调用
Types ¶
type HttpClient ¶
func Create ¶
func Create(client *http.Client) *HttpClient
func CreateDefault ¶
func CreateDefault() *HttpClient
func Default ¶ added in v0.2.7
func Default() *HttpClient
func (HttpClient) Delete ¶
func (c HttpClient) Delete(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
Delete 删除数据
func (HttpClient) Get ¶
func (c HttpClient) Get(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
func (HttpClient) PostFile ¶
func (c HttpClient) PostFile(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
func (HttpClient) PostForm ¶
func (c HttpClient) PostForm(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
func (HttpClient) PostJson ¶
func (c HttpClient) PostJson(ctx context.Context, httpRequestParams *HttpRequestParams) (result []byte, err error)
func (HttpClient) PostJsonOriResp ¶
func (c HttpClient) PostJsonOriResp(ctx context.Context, httpRequestParams *HttpRequestParams) (result *http.Response, err error)
PostJsonOriResp 此方法需要在外部设置content 超时,并进行defer cancel
type HttpRequestFileParams ¶
type HttpRequestParams ¶
Click to show internal directories.
Click to hide internal directories.