Documentation
¶
Index ¶
- Variables
- func MiniProgramDecrypt(sessionKey, encryptedData, biv string) ([]byte, error)
- func MiniProgramVerifySign(sessionKey, rawData, signature string) bool
- func PCKSUnPadding(origData []byte) ([]byte, error)
- type Client
- func (sf *Client) Exchange(ctx context.Context, code string) (*Token, error)
- func (sf *Client) GetUserInfo(ctx context.Context, accessToken, openid string) (*UserInfoResponse, error)
- func (sf *Client) MiniProgramCode2Session(ctx context.Context, code string) (*MiniProgramCode2SessionResponse, error)
- func (sf *Client) RefreshToken(ctx context.Context, refreshToken string) (*Token, error)
- func (sf *Client) VerifyAuthToken(ctx context.Context, accessToken string) error
- type Config
- type ErrResponse
- type MiniProgramCode2SessionResponse
- type Token
- type UserInfoResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidIvSize = errors.New("iv length must equal block size") ErrUnPaddingOutOfRange = errors.New("unPadding out of range") )
error defined
Functions ¶
func MiniProgramDecrypt ¶
func MiniProgramVerifySign ¶
func PCKSUnPadding ¶
PCKSUnPadding PKCS#5和PKCS#7 解填充
Types ¶
type Client ¶
type Client struct { *Config *resty.Client }
func (*Client) GetUserInfo ¶
func (*Client) MiniProgramCode2Session ¶
func (*Client) RefreshToken ¶
type Config ¶
type ErrResponse ¶
type UserInfoResponse ¶
type UserInfoResponse struct { Unionid string `json:"unionid"` // 用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。 Openid string `json:"openid"` // 普通用户的标识,对当前开发者帐号唯一 Nickname string `json:"nickname"` // 昵称 Sex int `json:"sex"` // 性别, 1:男 2: 女 Province string `json:"province"` // 省 City string `json:"city"` // 市 Country string `json:"country"` // 国家, 中国为CN Headimgurl string `json:"headimgurl"` // 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空 Privilege []string `json:"privilege"` // 用户特权信息,json数组,如微信沃卡用户为(chinaunicom) }
Click to show internal directories.
Click to hide internal directories.