wechat

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AppID appid
	AppID string

	// AppSecret app secret
	AppSecret string
)

Functions

This section is empty.

Types

type Message

type Message struct {
	AppID       string `json:"appid,omitempty" url:"-"`
	JSapiTicket string `json:"jsapi_ticket,omitempty" url:"jsapi_ticket,omitempty"`
	Noncestr    string `json:"noncestr,omitempty" url:"noncestr,omitempty"`
	Timestamp   string `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	URL         string `json:"url,omitempty" url:"url,omitempty"`
	Signature   string `json:"signature,omitempty" url:"-"`
}

Message message

func NewMessage

func NewMessage() *Message

NewMessage new message

func (*Message) Share

func (m *Message) Share(path string) (*Message, error)

Share message share

type Ticket

type Ticket struct {
	Ticket    string `json:"ticket,omitempty"`
	ExpiresIn int    `json:"expires_in,omitempty"`
	ErrCode   int    `json:"errcode,omitempty"`
	ErrMsg    string `json:"errmsg,omitempty"`
}

Ticket ticket

func NewTicket

func NewTicket() *Ticket

NewTicket new ticket

func (*Ticket) Get added in v1.1.8

func (t *Ticket) Get() (*Ticket, error)

Get get ticket

func (*Ticket) JSAPI

func (t *Ticket) JSAPI() (string, error)

JSAPI jsapi ticket

type Token

type Token struct {
	AccessToken  string `json:"access_token,omitempty"`  // 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同
	ExpiresIn    int    `json:"expires_in,omitempty"`    // access_token接口调用凭证超时时间,单位(秒)
	RefreshToken string `json:"refresh_token,omitempty"` // 用户刷新access_token
	OpenID       string `json:"openid,omitempty"`        // 用户唯一标识
	Scope        string `json:"scope,omitempty"`         // 用户授权的作用域,使用逗号(,)分隔
	ErrCode      int    `json:"errcode,omitempty"`       // 错误代码
	ErrMsg       string `json:"errmsg,omitempty"`        // 错误消息
}

Token token

func NewToken

func NewToken() *Token

NewToken new token

func (*Token) Access

func (t *Token) Access() (string, error)

Access access token

func (*Token) Get added in v1.1.8

func (t *Token) Get() (*Token, error)

Get get token

Jump to

Keyboard shortcuts

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