Documentation
¶
Index ¶
- Constants
- func CheckHttpError(err error)
- type AliHttpClient
- func (this *AliHttpClient) CalcSign(values url.Values) string
- func (this *AliHttpClient) GetRequest(method string, params map[string]string) *http.Response
- func (this *AliHttpClient) ParserRespBody(method string, entityKey string, resp *http.Response) (bool, interface{}, *ResponseEntity, *ErrorResponse)
- func (this *AliHttpClient) ParserRespBodyWithoutData(method string, resp *http.Response) (bool, interface{}, *ErrorResponse)
- func (this *AliHttpClient) PostRequest(method string, params map[string]string) *http.Response
- func (this *AliHttpClient) String() string
- type ErrorResponse
- type ResponseEntity
Constants ¶
View Source
const ( ERROR_CODE_SERVER_ERROR = 10000 //系统异常了,无法处理 ERROR_CODE_ILLEGAL_PARAM = 10001 //参数错误 ERROR_CODE_RECORD_ALREADY_EXIST = 20001 //记录已经存在,判断依据是根据mobile、email、login_id、isv_account_id、open_id ERROR_CODE_RECORD_NOT_EXIST = 20002 //记录不存在,如删除的时候传了错误的id或isv_account_id ERROR_CODE_DOMAIN_MISMATCH = 20004 //数据域检查错误,操作了不属于自己域的数据) ERROR_CODE_UPDATE_FAIL = 20005 //更新时DB异常 ERROR_CODE_INSERT_FAIL = 20006 //插入时DB异常 ERROR_CODE_INSERT_INDEX_FAIL = 20007 //写索引DB异常 ERROR_CODE_INVALID_TOKEN = 20008 //Token错误或者验证时间超过了1分钟 )
Variables ¶
This section is empty.
Functions ¶
func CheckHttpError ¶
func CheckHttpError(err error)
Types ¶
type AliHttpClient ¶
type AliHttpClient struct {
// contains filtered or unexported fields
}
func NewAliHttpClient ¶
func NewAliHttpClient(baseUrl string, appkey string, appSecret string, partnerId string) *AliHttpClient
func (*AliHttpClient) GetRequest ¶
func (*AliHttpClient) ParserRespBody ¶
func (this *AliHttpClient) ParserRespBody(method string, entityKey string, resp *http.Response) (bool, interface{}, *ResponseEntity, *ErrorResponse)
func (*AliHttpClient) ParserRespBodyWithoutData ¶
func (this *AliHttpClient) ParserRespBodyWithoutData(method string, resp *http.Response) (bool, interface{}, *ErrorResponse)
func (*AliHttpClient) PostRequest ¶
func (*AliHttpClient) String ¶
func (this *AliHttpClient) String() string
type ErrorResponse ¶
type ErrorResponse struct {
Code float64 `json:"code"`
Msg string `json:"msg"`
SubCode string `json:"sub_code"`
SubMsg string `json:"sub_msg"`
RequestId string `json:"request_id"`
}
func (*ErrorResponse) Parse ¶
func (this *ErrorResponse) Parse(res map[string]interface{})
type ResponseEntity ¶
type ResponseEntity struct {
Message string `json:"message"`
Successful bool `json:"successful"`
Code float64 `json:"code"`
}
func (*ResponseEntity) Parse ¶
func (this *ResponseEntity) Parse(res map[string]interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.