Help us shape the future of Go! Take the 2026 Go Developer Survey

urllink

package
v2.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuotaInfo added in v2.1.9

type QuotaInfo struct {
	RemainVisitQuota int64 `json:"remain_visit_quota"`
}

QuotaInfo quota 配置

type TExpireType

type TExpireType int

TExpireType 失效类型 (指定时间戳/指定间隔)

const (
	// ExpireTypeTime 指定时间戳后失效
	ExpireTypeTime TExpireType = 0

	// ExpireTypeInterval 间隔指定天数后失效
	ExpireTypeInterval TExpireType = 1
)

type ULParams

type ULParams struct {
	Path  string `json:"path"`
	Query string `json:"query"`
	// envVersion 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"
	EnvVersion     string      `json:"env_version,omitempty"`
	IsExpire       bool        `json:"is_expire"`
	ExpireType     TExpireType `json:"expire_type"`
	ExpireTime     int64       `json:"expire_time"`
	ExpireInterval int         `json:"expire_interval"`
}

ULParams 请求参数 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html#请求参数

type ULQueryRequest added in v2.1.9

type ULQueryRequest struct {
	URLLink   string `json:"url_link"`
	QueryType int    `json:"query_type"`
}

ULQueryRequest 查询加密URLLink请求

type ULQueryResult added in v2.1.4

type ULQueryResult struct {
	util.CommonError

	URLLinkInfo struct {
		Appid      string `json:"appid"`
		Path       string `json:"path"`
		Query      string `json:"query"`
		CreateTime int64  `json:"create_time"`
		ExpireTime int64  `json:"expire_time"`
		EnvVersion string `json:"env_version"`
		CloudBase  struct {
			Env           string `json:"env"`
			Domain        string `json:"domain"`
			Path          string `json:"path"`
			Query         string `json:"query"`
			ResourceAppid string `json:"resource_appid"`
		} `json:"cloud_base"`
	} `json:"url_link_info"`
	VisitOpenid string    `json:"visit_openid"`
	QuotaInfo   QuotaInfo `json:"quota_info"`
}

ULQueryResult 返回的结果 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.query.html 返回值

type ULResult

type ULResult struct {
	util.CommonError

	URLLink string `json:"url_link"`
}

ULResult 返回的结果 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html#返回值

type URLLink struct {
	*context.Context
}

URLLink 小程序 URL Link

func NewURLLink(ctx *context.Context) *URLLink

NewURLLink 实例化

func (*URLLink) Generate

func (u *URLLink) Generate(params *ULParams) (string, error)

Generate 生成url link

func (*URLLink) Query added in v2.1.4

func (u *URLLink) Query(urlLink string) (*ULQueryResult, error)

Query 查询小程序 url_link 配置。

func (*URLLink) QueryWithType added in v2.1.9

func (u *URLLink) QueryWithType(req *ULQueryRequest) (*ULQueryResult, error)

QueryWithType 查询加密URLLink see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/url-link/queryUrlLink.html

Jump to

Keyboard shortcuts

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