Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client representing a instance
func NewClient ¶
NewClient: create and return a new client
clientId identify of client secretKey key of secret secretVal value of secret
func (*Client) Call ¶
Call: call remote function
Response response from remote server response if valid if error is nil
func (*Client) EnableTestMode ¶
func (p *Client) EnableTestMode()
EnableTestMode: enable test mode
Warnning: if you call method with test mode ,the reponse will be different. So DO NOT use it on production mode
type Response ¶
type Response struct {
// Code response code
//
// |code | describe |
// |------|---------------------------------|
// |0 | success |
// |10000 | IP not in whitelist |
// |10001 | Request path error |
// |10002 | Internal server error |
// |10100 | Param cilent_id required |
// |10101 | Param client_id not found |
// |10102 | This service is not activated |
// |10200 | Secret key required |
// |10201 | Secret not found |
// |10202 | Decode failed |
// |10203 | Get request body failed |
// |10300 | Service not found |
// |10999 | Other error |
//
// code 0 means success, others means errors
Code string `json:"code,omitempty"`
// Msg the message of response
// if code not 0, the msg will tell you the reason
Msg string `json:"msg,omitempty"`
// Data the data of response, The responses are different depending on the service
// if code not 0, the data will be nil
Data interface{} `json:"data,omitempty"`
}
Response is the response of request
Click to show internal directories.
Click to hide internal directories.