wechat

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 11 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) Cache

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

Cache get ticket from cache

func (*Ticket) JSAPI

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

JSAPI jsapi ticket

func (*Ticket) Network

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

Network get ticket form network

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) Cache

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

Cache get token from cache

func (*Token) Network

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

Network get token from network

Jump to

Keyboard shortcuts

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