qr

package
Version: v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 5, 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(tq *Request) (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 临时二维码

func NewLimitQrRequest

func NewLimitQrRequest(scene interface{}) *Request

NewLimitQrRequest 新建永久二维码请求实例

func NewTmpQrRequest

func NewTmpQrRequest(exp time.Duration, scene interface{}) *Request

NewTmpQrRequest 新建临时二维码请求实例

type Ticket

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

Ticket 二维码ticket

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL