wechat

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCredentialToken

type ClientCredentialToken struct {
	AccessToken  string `json:"access_token,omitempty"`
	ExpireIn     int64  `json:"expire_in,omitempty"`
	ErrorCode    int64  `json:"errcode,omitempty"`
	ErrorMessage string `json:"errmsg,omitempty"`
	Timestamp    int64  `json:"timestamp"`
}

func (ClientCredentialToken) Expired

func (t ClientCredentialToken) Expired() bool

type MpMsgReq

type MpMsgReq struct {
	AppId       string `json:"appid"`
	TemplateId  string `json:"template_id"`
	Url         string `json:"url"`
	Data        string `json:"data"`
	MiniProgram string `json:"miniprogram"`
}

type PayloadItem

type PayloadItem struct {
	Content string `json:"content"`
	Color   string `json:"color,omitempty"`
}

type Provider

type Provider struct {
	Host      string // wechat公众号provider地址
	AppId     string
	AppSecret string
	// contains filtered or unexported fields
}

func (*Provider) Send

func (p *Provider) Send(req Req) (err error)

type Req

type Req struct {
	ToUser string   `json:"touser"`
	MpMsg  MpMsgReq `json:"mp_template_msg"`
}

type Resp

type Resp struct {
	ErrorCode int    `json:"errcode,omitempty"`
	ErrorMsg  string `json:"errmsg,omitempty"`
}

type Sender

type Sender struct {
	Host      string // wechat open platform sender server
	AppSecret string // app secret
	AppId     string // app id
}

type To

type To struct {
	OpenId     string                 // user's open id of wechat open platform
	Payload    map[string]PayloadItem // data
	TemplateId string                 // tpl id on wechat open platform
}

Jump to

Keyboard shortcuts

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