qrcode

package
v0.0.0-...-63002a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitQrcodeReply

type LimitQrcodeReply struct {
	Ticket string `json:"ticket"` // 获取的二维码ticket,凭借此ticket可以在有效时间内换取二维码。
	URL    string `json:"url"`    // 二维码图片解析后的地址,开发者可根据该地址自行生成需要的二维码图片
}

LimitQrcodeReply 永久二维码回复

type LimitQrcodeRequest

type LimitQrcodeRequest struct {
	ActionName string                 `json:"action_name"` // 二维码类型,QR_SCENE为临时的整型参数值,QR_STR_SCENE为临时的字符串参数值,QR_LIMIT_SCENE为永久的整型参数值,QR_LIMIT_STR_SCENE为永久的字符串参数值
	ActionInfo map[string]interface{} `json:"action_info"` // 二维码详细信息
}

LimitQrcodeRequest 永久二维码

func NewLimitQrcodeRequest

func NewLimitQrcodeRequest(num uint) *LimitQrcodeRequest

NewLimitQrcodeRequest 创建一个永久二维码 场景值ID,临时二维码时为32位非0整型,永久二维码时最大值为100000(目前参数只支持1--100000)

func NewStrLimitQrcodeRequest

func NewStrLimitQrcodeRequest(str string) *LimitQrcodeRequest

NewStrLimitQrcodeRequest 创建一个永久字符串二维码 场景值ID(字符串形式的ID),字符串类型,长度限制为1到64

type Qrcode

type Qrcode struct {
	// contains filtered or unexported fields
}

Qrcode 二维码

func NewQrcode

func NewQrcode(c wechat.Clienter) *Qrcode

NewQrcode ...

func (*Qrcode) CreateLimit

func (q *Qrcode) CreateLimit(req *LimitQrcodeRequest) (*LimitQrcodeReply, error)

CreateLimit 生成一个永久带参数的二维码

func (*Qrcode) CreateTemp

func (q *Qrcode) CreateTemp(req *TempQrcodeRequest) (*TempQrcodeReply, error)

CreateTemp 生成临时带参数的二维码

func (*Qrcode) Download

func (q *Qrcode) Download(ticket string) ([]byte, error)

Download 下载二维码

type TempQrcodeReply

type TempQrcodeReply struct {
	Ticket        string `json:"ticket"`         // 获取的二维码ticket,凭借此ticket可以在有效时间内换取二维码。
	ExpireSeconds int    `json:"expire_seconds"` // 该二维码有效时间,以秒为单位。 最大不超过2592000(即30天)。
	URL           string `json:"url"`            // 二维码图片解析后的地址,开发者可根据该地址自行生成需要的二维码图片
}

TempQrcodeReply 临时二维码回复

type TempQrcodeRequest

type TempQrcodeRequest struct {
	ExpireSeconds int                    `json:"expire_seconds"` // 该二维码有效时间,以秒为单位。 最大不超过2592000(即30天),此字段如果不填,则默认有效期为30秒。
	ActionName    string                 `json:"action_name"`    // 二维码类型,QR_SCENE为临时的整型参数值,QR_STR_SCENE为临时的字符串参数值,QR_LIMIT_SCENE为永久的整型参数值,QR_LIMIT_STR_SCENE为永久的字符串参数值
	ActionInfo    map[string]interface{} `json:"action_info"`    // 二维码详细信息
}

TempQrcodeRequest ,临时二维码

func NewTempQrcodeRequest

func NewTempQrcodeRequest(num uint, expireSeconds int) *TempQrcodeRequest

NewTempQrcodeRequest 创建一个临时二维码 场景值ID,临时二维码时为32位非0整型,永久二维码时最大值为100000(目前参数只支持1--100000)

func NewTempStrQrcodeRequest

func NewTempStrQrcodeRequest(str string, expireSeconds int) *TempQrcodeRequest

NewTempStrQrcodeRequest 创建一个临时字符串二维码 场景值ID(字符串形式的ID),字符串类型,长度限制为1到64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL