Documentation
¶
Overview ¶
Package model API models
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse struct {
// RequestID .
RequestID string `json:"request_id,omitempty" xml:"request_id,omitempty"`
}
BaseResponse .
type CommonRequest ¶
type CommonRequest struct {
// Type API接口名,形如:pdd.*
Type string `json:"type,omitempty"`
// ClientID 已创建成功的应用标志client_id,可在应用详情和中查看
ClientID string `json:"client_id,omitempty"`
// Sign API入参参数签名,签名值根据如下算法给出计算过程
Sign string `json:"sign,omitempty"`
// AccessToken 用户授权令牌access_token,通过pdd.pop.auth.token.create获取
AccessToken string `json:"access_token,omitempty"`
// Version API版本,默认为V1,无要求不传此参数
Version string `json:"version,omitempty"`
// DataType 请求返回的数据格式,可选参数为XML或JSON,默认为JSON
DataType RequestDataType `json:"data_type,omitempty"`
// Timestamp 时间戳,格式为UNIX时间(秒)
Timestamp int64 `json:"timestamp,omitempty"`
}
CommonRequest 请求公共参数
func (CommonRequest) GetType ¶
func (r CommonRequest) GetType() string
GetType implement Request interface
type CommonResponse ¶
type CommonResponse struct {
ErrorResponse *ErrorResponse `json:"error_response,omitempty" xml:"error_response,omitempty"`
}
CommonResponse API Response
type ErrorResponse ¶
type ErrorResponse struct {
BaseResponse
ErrorCode int `json:"error_code" xml:"error_code"`
ErrorMsg string `json:"error_msg" xml:"error_msg"`
SubMsg string `json:"sub_msg" xml:"sub_msg"`
SubCode string `json:"sub_code" xml:"sub_code"`
}
ErrorResponse Response Error
type Int ¶ added in v1.1.23
type Int int
Int support string quoted number in json
func (*Int) UnmarshalJSON ¶ added in v1.1.23
UnmarshalJSON implement json Unmarshal interface
type RequestDataType ¶
type RequestDataType string
RequestDataType 请求返回的数据格式,可选参数为XML或JSON,默认为JSON
const ( // RequestDataType_JSON 返回JSON格式 RequestDataType_JSON RequestDataType = "JSON" // RequestDataType_XML 返回X M Lg格式 RequestDataType_XML RequestDataType = "XML" )
type Uint64 ¶ added in v1.1.23
type Uint64 uint64
Uint64 support string quoted number in json
func (*Uint64) UnmarshalJSON ¶ added in v1.1.23
UnmarshalJSON implement json Unmarshal interface
type UploadField ¶ added in v1.1.6
type UploadField struct {
// Reader upload file reader
Reader io.Reader
// Key field key
Key string
// Value field value
Value string
}
UploadField multipart/form-data post request field struct
type UploadRequest ¶ added in v1.1.6
type UploadRequest interface {
// Encode encode request to UploadFields
Encode() []UploadField
GetType() string
}
UploadRequest multipart/form-data reqeust interface
Click to show internal directories.
Click to hide internal directories.