token

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdGetAccessToken

func CmdGetAccessToken(arg *CmdTokenParams) error

CmdGetAccessToken 获取微信接口调用凭证

Types

type AccessTokenMeta

type AccessTokenMeta struct {
	AccessToken string    `json:"access_token"`        // 微信接口调用凭证
	ExpireIn    int64     `json:"expires_in"`          // 微信接口调用凭证有效时间,单位:秒
	ExpireAt    time.Time `json:"expire_at,omitempty"` // 微信接口调用凭证到期时间
}

func FetchAccessToken

func FetchAccessToken(appID, appSecret string) (*AccessTokenMeta, error)

FetchAccessToken 获取微信接口调用凭证 正常情况下,微信会返回下述 JSON {"access_token":"ACCESS_TOKEN","expires_in":7200} 错误时微信会返回错误码等信息,JSON数据包示例如下: {"errcode":40013,"errmsg":"invalid appid"}

func (AccessTokenMeta) String

func (t AccessTokenMeta) String() string

type AccessTokenResponse

type AccessTokenResponse struct {
	weixin.ResponseMeta
	AccessTokenMeta
}

AccessTokenResponse 响应

type CmdTokenParams

type CmdTokenParams struct {
	UserAgent string
	AppID     string
	AppSecret string
}

Jump to

Keyboard shortcuts

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