qr

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowQRCode

func ShowQRCode(tk *Ticket) string

ShowQRCode 通过ticket换取二维码

Types

type QR

type QR struct {
	*context.Context
}

QR 二维码

func NewQR

func NewQR(context *context.Context) *QR

NewQR 二维码实例

func (*QR) GetQRTicket

func (q *QR) GetQRTicket(scene interface{}, exp ...time.Duration) (t *Ticket, err error)

GetQRTicket 获取二维码 Ticket

type Request

type Request struct {
	ExpireSeconds int64  `json:"expire_seconds,omitempty"`
	ActionName    string `json:"action_name"`
	ActionInfo    struct {
		Scene struct {
			SceneStr string `json:"scene_str,omitempty"`
			SceneID  int    `json:"scene_id,omitempty"`
		} `json:"scene"`
	} `json:"action_info"`
}

Request 临时二维码

type Ticket

type Ticket struct {
	util.CommonError
	Ticket        string `json:"ticket"`
	ExpireSeconds int64  `json:"expire_seconds"`
	URL           string `json:"url"`
}

Ticket 二维码ticket

Jump to

Keyboard shortcuts

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