Documentation ¶
Index ¶
- func Call(httpCtxIn *hfw.HTTPContext, header map[string]string, ...) (err error)
- func Download(httpCtx *hfw.HTTPContext, url string, p interface{}) (content []byte, err error)
- func RequestUnmarshal(httpCtx *hfw.HTTPContext, params interface{}) (err error)
- func StdCall(httpCtx *hfw.HTTPContext, addressParams interface{}, uri string, p interface{}, ...) (err error)
- func StdCallByConsul(httpCtx *hfw.HTTPContext, serviceName, uri string, p interface{}, ...) (err error)
- type AddHeadersCallOption
- type CallOption
- type DelHeadersCallOption
- type Response
- type TimeOutCallOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
func Call(httpCtxIn *hfw.HTTPContext, header map[string]string, addressParams interface{}, uri string, p interface{}, resp interface{}, opts ...CallOption) (err error)
用于任意返回json数据的http服务
func Download ¶
func Download(httpCtx *hfw.HTTPContext, url string, p interface{}) (content []byte, err error)
func RequestUnmarshal ¶
func RequestUnmarshal(httpCtx *hfw.HTTPContext, params interface{}) (err error)
RequestUnmarshal 从httpCtx里解析数据到params
func StdCall ¶
func StdCall(httpCtx *hfw.HTTPContext, addressParams interface{}, uri string, p interface{}, results interface{}, opts ...CallOption) (err error)
用于调用内部的其他标准http服务 标准的http服务是指response里包含err_no、err_msg和results
func StdCallByConsul ¶
func StdCallByConsul(httpCtx *hfw.HTTPContext, serviceName, uri string, p interface{}, results interface{}, opts ...CallOption) (err error)
用于调用内部的其他标准http服务 标准的http服务是指response里包含err_no、err_msg和results
Types ¶
type AddHeadersCallOption ¶
type AddHeadersCallOption struct {
// contains filtered or unexported fields
}
type CallOption ¶
func NewAddHeadersCallOption ¶
func NewAddHeadersCallOption(headers map[string]string) CallOption
func NewDelHeadersCallOption ¶
func NewDelHeadersCallOption(keys ...string) CallOption
func NewTimeOutCallOption ¶
func NewTimeOutCallOption(timeout int) CallOption
type DelHeadersCallOption ¶
type DelHeadersCallOption struct {
// contains filtered or unexported fields
}
type Response ¶
type Response struct { ErrNo int64 `json:"err_no"` ErrMsg string `json:"err_msg"` Results interface{} `json:"results"` }
内部第三方接口返回
type TimeOutCallOption ¶
type TimeOutCallOption struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.