hms

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 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 Client

type Client struct {
	AppId     string
	AppSecret string
}

Client hms client

func NewClient

func NewClient(appId, secret string) *Client

NewClient NewClient

传入appId和appSecret

func (*Client) CodeToAccessToken

func (c *Client) CodeToAccessToken(code string) (accessData *QuickAppAccessToken, err error)

CodeToAccessToken 根据code值换行accessToken

func (*Client) RefreshTokenToAccessToken

func (c *Client) RefreshTokenToAccessToken(refreshToken string) (accessData *QuickAppAccessToken, err error)

RefreshTokenToAccessToken 用refreshToken换accessToken

type QuickAppAccessToken

type QuickAppAccessToken struct {
	AccessToken    string `json:"access_token"`
	ExpiresIn      int    `json:"expires_in"`
	RefreshToken   string `json:"refresh_token"`
	Scope          string `json:"scope"`
	TokenType      int64  `json:"token_type"`
	Error          string `json:"error"`
	ErrDescription string `json:"error_description"`
}

QuickAppAccessToken 华为accesstoken应答参数

Jump to

Keyboard shortcuts

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