Documentation ¶
Overview ¶
帐号管理接口.
Index ¶
- Constants
- func QRCodeDownload(ticket, filepath string, clt *http.Client) (written int64, err error)
- func QRCodeDownloadToWriter(ticket string, writer io.Writer, clt *http.Client) (written int64, err error)
- func QRCodePicURL(ticket string) string
- type Client
- func (clt *Client) CreatePermanentQRCode(SceneId uint32) (qrcode *PermanentQRCode, err error)
- func (clt *Client) CreatePermanentQRCodeWithSceneString(SceneString string) (qrcode *PermanentQRCode, err error)
- func (clt *Client) CreateTemporaryQRCode(SceneId uint32, ExpireSeconds int) (qrcode *TemporaryQRCode, err error)
- func (clt *Client) QRCodeDownload(ticket, filepath string) (written int64, err error)
- func (clt *Client) QRCodeDownloadToWriter(ticket string, writer io.Writer) (written int64, err error)
- func (clt *Client) ShortURL(longURL string) (shortURL string, err error)
- type PermanentQRCode
- type TemporaryQRCode
Constants ¶
View Source
const ( TemporaryQRCodeExpireSecondsLimit = 604800 // 临时二维码 expire_seconds 限制 PermanentQRCodeSceneIdLimit = 100000 // 永久二维码 scene_id 限制 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func (*Client) CreatePermanentQRCode ¶
func (clt *Client) CreatePermanentQRCode(SceneId uint32) (qrcode *PermanentQRCode, err error)
创建永久二维码
SceneId: 场景值ID, 目前参数只支持1--100000
func (*Client) CreatePermanentQRCodeWithSceneString ¶
func (clt *Client) CreatePermanentQRCodeWithSceneString(SceneString string) (qrcode *PermanentQRCode, err error)
创建永久二维码
SceneString: 场景值ID(字符串形式的ID), 字符串类型, 长度限制为1到64
func (*Client) CreateTemporaryQRCode ¶
func (clt *Client) CreateTemporaryQRCode(SceneId uint32, ExpireSeconds int) (qrcode *TemporaryQRCode, err error)
创建临时二维码
SceneId: 场景值ID, 为32位非0整型 ExpireSeconds: 二维码有效时间, 以秒为单位. 最大不超过 604800.
func (*Client) QRCodeDownload ¶
通过ticket换取二维码, 写入到 filepath 路径的文件.
type PermanentQRCode ¶
type PermanentQRCode struct { // 下面两个字段同时只有一个有效, 非zero值表示有效. SceneId uint32 `json:"scene_id,omitempty"` // 场景值ID, 临时二维码时为32位非0整型, 永久二维码时最大值为100000(目前参数只支持1--100000) SceneString string `json:"scene_str,omitempty"` // 场景值ID(字符串形式的ID), 字符串类型, 长度限制为1到64, 仅永久二维码支持此字段 Ticket string `json:"ticket"` // 获取的二维码ticket, 凭借此ticket可以在有效时间内换取二维码. URL string `json:"url"` // 二维码图片解析后的地址, 开发者可根据该地址自行生成需要的二维码图片 }
永久二维码
type TemporaryQRCode ¶
type TemporaryQRCode struct { ExpireSeconds int `json:"expire_seconds,omitempty"` // 二维码的有效时间, 以秒为单位. 最大不超过 604800. PermanentQRCode }
临时二维码
Click to show internal directories.
Click to hide internal directories.