Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Config Config // contains filtered or unexported fields }
Client 旺店通直连客户端
func (*Client) CallWithoutMiddleware ¶ added in v0.1.4
CallWithoutMiddleware 执行请求方法,不包含中间件
type Config ¶
type Config struct { Url string `json:"url"` // 接口请求地址 V string `json:"v"` Sid string `json:"sid"` // 卖家账号 AppKey string `json:"appkey"` // 旺店通旗舰版appkey AppSecret string `json:"appsecret"` // 旺店通旗舰版appsecret }
Config 旺店通直连配置
type Context ¶ added in v0.1.4
type Context struct { Request *Request Response *Response Client *Client // contains filtered or unexported fields }
Context 旺店通直连上下文管理器
type QimenClient ¶ added in v0.0.7
type QimenClient struct { Config QimenConfig // contains filtered or unexported fields }
QimenClient 奇门客户端
func NewGwdtQimenClient ¶ added in v0.0.7
func NewGwdtQimenClient(qimenConfig QimenConfig) *QimenClient
NewGwdtQimenClient 奇门客户端构建函数
func (*QimenClient) Call ¶ added in v0.0.7
func (c *QimenClient) Call(request *QimenRequest) *QimenResponse
Call 执行奇门接口请求
func (*QimenClient) CallWithoutMiddleware ¶ added in v0.1.4
func (c *QimenClient) CallWithoutMiddleware(request *QimenRequest) *QimenResponse
CallWithoutMiddleware 执行奇门接口请求,不执行中间件
func (*QimenClient) Use ¶ added in v0.1.4
func (c *QimenClient) Use(middleware func(ctx *QimenContext))
Use 添加奇门中间件
type QimenConfig ¶ added in v0.0.7
type QimenConfig struct { QimenUrl string `json:"qimen_url"` // 奇门地址 QimenAppKey string `json:"qimen_appkey"` // 奇门appkey QimenAppSecret string `json:"qimen_appsecret"` // 奇门appsecret Sid string `json:"sid"` // 卖家账号 WdtAppKey string `json:"wdt_appkey"` // 旺店通旗舰版appkey WdtAppSecret string `json:"wdt_appsecret"` // 旺店通旗舰版appsecret TargetAppkey string `json:"target_appkey"` // 目标appkey }
QimenConfig 奇门配置
type QimenContext ¶ added in v0.1.4
type QimenContext struct { Request *QimenRequest Response *QimenResponse Client *QimenClient // contains filtered or unexported fields }
QimenContext 奇门上下文管理器
type QimenError ¶ added in v0.0.7
type QimenResponse ¶ added in v0.0.7
type QimenResponse struct { Request *QimenRequest // 原始请求 Status int64 // 状态码,-1为请求失败,0为请求成功,1为返回错误 Error *QimenError // 返回错误 DateTime string // 按照旺店通规则的请求时间戳 Sign string // 奇门签名 WdtSign string // 按照旺店通规则的签名 Data string // 返回数据json字符串 TotalCount int64 // 分页查询返回的总记录数,仅当分页获取总数时返回 }
QimenResponse 奇门响应
func (*QimenResponse) Get ¶ added in v0.1.3
func (c *QimenResponse) Get(key string) string
Get 按键获取奇门返回数据
func (*QimenResponse) GetByte ¶ added in v0.1.3
func (c *QimenResponse) GetByte() []byte
GetByte 获取奇门返回数据
func (*QimenResponse) HasMore ¶ added in v0.1.3
func (c *QimenResponse) HasMore() bool
HasMore 是否还有更多数据,仅分页且获取总数时返回
Click to show internal directories.
Click to hide internal directories.