Documentation
¶
Index ¶
- Constants
- func BuildParams(appkey, secret, AccessToken, method string, payload []byte, ...) string
- func GetTimestamp() string
- func HttpGet(url string) (body string, err error)
- func HttpPost(url, contentType, data string) (body string, err error)
- func MethodName(request interface{}) string
- func MissingAppKey(formt ResponseFormat) string
- func MissingMethod(format ResponseFormat) string
- func QimenEventName(status QimenEventStatus) (name string)
- func Sign(form IParameterMap, secret string, payload []byte) string
- func SignHmac(params Parameters, secret string, payload []byte) string
- func SignMd5(params Parameters, secret string, payload []byte) string
- func Value2Str(v *reflect.Value) (ans string)
- func ValueIsEmpty(v *reflect.Value) (ans bool)
- type App
- type Client
- func (self *Client) CallMethod(uri, AccessToken, method string, paramsMap IParameterMap, ...) (body string, err error)
- func (self *Client) CallMethodEx(uri, method string, ssn *Session, params IParameterMap, respFmt ResponseFormat) (body string, err error)
- func (self *Client) DoBatch(uri, AccessToken string, requests []IParameterMap, respFmt ResponseFormat) (body string, err error)
- func (self *Client) DoBatchEx(uri, AccessToken string, requests []interface{}, respFmt ResponseFormat) (body string, err error)
- func (self *Client) DoRequest(uri, AccessToken string, request interface{}, respFmt ResponseFormat) (body string, err error)
- func (self *Client) QimenEventsProduce(uri, AccessToken string, events QimenEvents) (err error)
- type ErrorResponse
- type ErrorResponseObject
- type FormValues
- type IParameterMap
- type LogisticsDummySendRequest
- type LogisticsDummySendResponse
- type LogisticsDummySendResponseRoot
- type NewSession
- type Order
- type Orders
- type Parameter
- type ParameterMap
- type Parameters
- type QimenEvent
- type QimenEventProduceRequest
- type QimenEventProduceResponse
- type QimenEventProduceResponseRoot
- type QimenEventStatus
- type QimenEvents
- type QimenEventsProduceResponse
- type QimenEventsProduceResponseRoot
- type QimenResult
- type QimenResults
- type Request
- type ResponseFormat
- type Session
- type Shipping
- type SignMethod
- type Trade
- type TradeFullinfoGetResponse
- type TradeFullinfoGetResponseRoot
- type Trades
- type TradesSoldGetRequest
- type TradesSoldGetResponse
- type TradesSoldGetResponseRoot
- type UserSellerGetRequest
Constants ¶
View Source
const ( QimenErpTransfer = iota QimenErpCheck QimenCpNotify QimenCpOut )
View Source
const ( UnknownSign = iota Md5Sign HmacSign )
View Source
const ( UnknownResponse = iota JsonResponse XmlResponse )
View Source
const UriBatch string = "http://gw.api.taobao.com/router/batch"
View Source
const UriDefault string = "http://gw.api.taobao.com/router/rest"
gateway, some method must be called through https
View Source
const UriHttpsDefault string = "https://eco.taobao.com/router/rest"
View Source
const UriSandbox string = "http://mockgw.hz.taeapp.com/gw"
Variables ¶
This section is empty.
Functions ¶
func BuildParams ¶
func BuildParams(appkey, secret, AccessToken, method string, payload []byte, params IParameterMap, respFmt ResponseFormat) string
func GetTimestamp ¶
func GetTimestamp() string
func MethodName ¶
func MethodName(request interface{}) string
func MissingAppKey ¶
func MissingAppKey(formt ResponseFormat) string
func MissingMethod ¶
func MissingMethod(format ResponseFormat) string
func QimenEventName ¶
func QimenEventName(status QimenEventStatus) (name string)
func ValueIsEmpty ¶
Types ¶
type Client ¶
func (*Client) CallMethod ¶
func (self *Client) CallMethod(uri, AccessToken, method string, paramsMap IParameterMap, respFmt ResponseFormat) (body string, err error)
func (*Client) CallMethodEx ¶
func (self *Client) CallMethodEx(uri, method string, ssn *Session, params IParameterMap, respFmt ResponseFormat) (body string, err error)
func (*Client) DoBatch ¶
func (self *Client) DoBatch(uri, AccessToken string, requests []IParameterMap, respFmt ResponseFormat) (body string, err error)
func (*Client) DoBatchEx ¶
func (self *Client) DoBatchEx(uri, AccessToken string, requests []interface{}, respFmt ResponseFormat) (body string, err error)
func (*Client) DoRequest ¶
func (self *Client) DoRequest(uri, AccessToken string, request interface{}, respFmt ResponseFormat) (body string, err error)
func (*Client) QimenEventsProduce ¶
func (self *Client) QimenEventsProduce(uri, AccessToken string, events QimenEvents) (err error)
type ErrorResponse ¶
type ErrorResponse struct {
ErrorResponseObject `json:"error_response"`
}
type ErrorResponseObject ¶
type FormValues ¶
func (FormValues) Len ¶
func (self FormValues) Len() int
func (FormValues) Names ¶
func (self FormValues) Names() []string
func (FormValues) Set ¶
func (self FormValues) Set(name, value string)
type IParameterMap ¶
type LogisticsDummySendResponse ¶
type LogisticsDummySendResponse struct {
LogisticsDummySendResponseRoot `json:"logistics_dummy_send_response"`
}
type LogisticsDummySendResponseRoot ¶
type LogisticsDummySendResponseRoot struct {
Shipping `json:"shipping"`
}
type NewSession ¶
type NewSession struct {
R1ExpiresIn int `json:"r1_expires_in,string"`
W1ExpiresIn int `json:"w1_expires_in,string"`
R2ExpiresIn int `json:"r2_expires_in,string"`
W2ExpiresIn int `json:"w2_expires_in,string"`
ExpiresIn int `json:"expires_in,string"`
ReExpiresIn int `json:"re_expires_in,string"`
RefreshToken string `json:"refresh_token"`
AccessToken string `json:"top_session"`
Sign string `json:"sign"`
ErrCode int `json:"error,string"`
ErrDesc string `json:"error_description"`
}
func RefreshSession ¶
func RefreshSession(appkey, secret, AccessToken, RefreshToken string) (ans NewSession, err error)
type Order ¶
type Order struct {
BuyerRate bool `json:"buyer_rate"`
SellerRate bool `json:"seller_rate"`
Cid uint64 `json:"cid"`
Num uint `json:"num"`
NumIid uint64 `json:"num_iid"`
Oid uint64 `json:"oid"`
OuterIid string `json:"outer_iid"`
Payment string `json:"payment"`
Price string `json:"price"`
RefundStatus string `json:"refund_status"`
Status string `json:"status"`
Title string `json:"title"`
TotalFee string `json:"total_fee"`
}
type ParameterMap ¶
func NewParameterMap ¶
func NewParameterMap(capacity int) ParameterMap
func Struct2Map ¶
func Struct2Map(obj interface{}) (ans ParameterMap)
func (ParameterMap) Len ¶
func (self ParameterMap) Len() int
func (ParameterMap) Names ¶
func (self ParameterMap) Names() []string
func (ParameterMap) Set ¶
func (self ParameterMap) Set(name, value string)
type Parameters ¶
type Parameters []Parameter
func (Parameters) Len ¶
func (self Parameters) Len() int
func (Parameters) Less ¶
func (self Parameters) Less(i, j int) bool
func (Parameters) Swap ¶
func (self Parameters) Swap(i, j int)
type QimenEvent ¶
type QimenEvent struct {
Event QimenEventProduceRequest `json:"event"`
}
type QimenEventProduceResponse ¶
type QimenEventProduceResponse struct {
QimenEventProduceResponseRoot `json:"qimen_event_produce_response"`
}
type QimenEventProduceResponseRoot ¶
type QimenEventProduceResponseRoot struct {
IsSuccess bool `json:"is_success,omitempty,string"`
}
type QimenEventStatus ¶
type QimenEventStatus int
type QimenEvents ¶
type QimenEvents []QimenEvent
type QimenEventsProduceResponse ¶
type QimenEventsProduceResponse struct {
QimenEventsProduceResponseRoot `json:"qimen_events_produce_response"`
}
type QimenEventsProduceResponseRoot ¶
type QimenEventsProduceResponseRoot struct {
IsAllSuccess bool `json:"is_all_success,omitempty,string"`
Results QimenResults `json:"results,omitempty"`
}
type QimenResult ¶
type QimenResults ¶
type QimenResults struct {
QimenResult []QimenResult `json:"qimen_result,omitempty"`
}
type Request ¶
type Request struct {
//Timestamp string `json:"timestamp"`
//Sign string `json:"sign"`
//AppKey string `json:"app_key"`
Method string
TargetAppKey string `json:"target_app_key"`
SignMethod string `json:"sign_method"`
AccessToken string `json:"session"`
Format string `json:"format"`
Version string `json:"v"`
PartnerId string `json:"partner_id"`
Simplify bool `json:"simplify"`
}
type ResponseFormat ¶
type ResponseFormat int
response content-type, optional xml or json
func ResponseFormatFromName ¶
func ResponseFormatFromName(name string) ResponseFormat
type SignMethod ¶
type SignMethod int
sign method, optional md5 or hmac
func SignMethodFromName ¶
func SignMethodFromName(name string) SignMethod
type Trade ¶
type Trade struct {
Tid uint64 `json:"tid"`
SellerNick string `json:"seller_nick"`
BuyerNick string `json:"buyer_nick"`
Created string `json:"created"`
HasBuyerMessage bool `json:"has_buyer_message"`
Orders Orders `json:"orders"`
PayTime string `json:"pay_time"`
ReceiverAddress string `json:"receiver_address"`
ReceiverCity string `json:"receiver_city"`
ReceiverDistrict string `json:"receiver_district"`
ReceiverMobile string `json:"receiver_mobile"`
ReceiverName string `json:"receiver_name"`
ReceiverState string `json:"receiver_state"`
ReceiverZip string `json:"receiver_zip"`
SellerFlag int `json:"seller_flag"`
TotalFee string `json:"total_fee"`
Type string `json:"type"`
}
type TradeFullinfoGetResponse ¶
type TradeFullinfoGetResponse struct {
TradeFullinfoGetResponseRoot `json:"trade_fullinfo_get_response"`
}
type TradeFullinfoGetResponseRoot ¶
type TradeFullinfoGetResponseRoot struct {
Trade `json:"trade"`
}
type TradesSoldGetRequest ¶
type TradesSoldGetRequest struct {
Request
Fields string `json:"fields,omitempty"`
StartCreated string `json:"start_created,omitempty"`
EndCreated string `json:"end_created,omitempty"`
Status string `json:"status,omitempty"`
BuyerNick string `json:"buyer_nick,omitempty"`
Type string `json:"type,omitempty"`
ExtType string `json:"ext_type,omitempty"`
RateStatus string `json:"rate_status,omitempty"`
Tag string `json:"tag,omitempty"`
PageNo int `json:"page_no,omitempty"`
PageSize int `json:"page_size,omitempty"`
UseHasNext bool `json:"use_has_next,omitempty"`
}
type TradesSoldGetResponse ¶
type TradesSoldGetResponse struct {
TradesSoldGetResponseRoot `json:"trades_sold_get_response"`
}
type UserSellerGetRequest ¶
type UserSellerGetRequest struct {
Fields string `json:"fields"`
}
Click to show internal directories.
Click to hide internal directories.