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

wx

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TemplateMessage

type TemplateMessage struct {
	// 必要参数
	ToUser     string `json:"touser"`      // 发送给哪个openId
	TemplateId string `json:"template_id"` // 模板ID
	Data       map[string]struct {
		Value string `json:"value"`
	} `json:"data"` // 模板内容
	Url         string `json:"url"` // 跳转链接
	MiniProgram struct {
		AppId    string `json:"appid"`
		PagePath string `json:"pagepath"`
	} `json:"miniprogram"` // 跳小程序所需数据
	ClientMsgId string `json:"client_msg_id"` // 防重入id。对于同一个openid + client_msg_id, 只发送一条消息,10分钟有效,超过10分钟不保证效果。若无防重入需求,可不填
}

type WxAPI

type WxAPI interface {
	SendTemplateMessage(accessToken string, msg *TemplateMessage) error // 发送模板消息
}

func New

func New(appId, appSecret string) WxAPI

Jump to

Keyboard shortcuts

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