Documentation ¶
Index ¶
- Constants
- func GetRespWithoutData(code int, message string) string
- func GetRespWithoutDataEx(code int, message string) []byte
- func GetRespone(code int, message string, data interface{}) string
- func GetResponse(code int, message string, data interface{}) ([]byte, error)
- func GetResponseEx(code int, message string, data interface{}, extra map[string]interface{}) ([]byte, error)
- func InternalError(code int, message string) error
- func InternalErrorEx(code int, message string) ([]byte, error)
- func Request(url, method string, header http.Header, body io.Reader) (string, error)
- func RequestV2(url, method string, headSet []*HeaderSet, body io.Reader) (string, error)
- type APIRespone
- type HeaderSet
Constants ¶
View Source
const ( HEADER_APPID = "Bcs-Api-AppId" HEADER_APPCODE = "Bcs-Api-AppCode" HEADER_APPTOKEN = "Bcs-Api-AppToken" HEADER_OPERATOR = "Bcs-Api-Operator" )
Variables ¶
This section is empty.
Functions ¶
func GetRespWithoutData ¶
func GetRespWithoutDataEx ¶
func GetRespone ¶
GetRespone deprecated: best to use GetResponse instead.
func GetResponse ¶
GetResponse adaptor
func GetResponseEx ¶
func GetResponseEx(code int, message string, data interface{}, extra map[string]interface{}) ([]byte, error)
GetResponseEx extension adaptor
func InternalError ¶
InternalError internal error type exchange
func InternalErrorEx ¶
InternalErrorEx internal error type exchange
Types ¶
type APIRespone ¶
type APIRespone struct { Result bool `json:"result"` Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
APIResponse response for api request
Click to show internal directories.
Click to hide internal directories.