api

package
v0.0.0-...-a91bc6d Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success       = 0
	InvalidOpenId = 40003
	ErrTypeConn   = "connerr"
	ErrTypeResp   = "resperr"
	ErrTypeApi    = "apierr"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Type    string
	Code    int64
	Message string
}

func (*ApiError) Error

func (this *ApiError) Error() string

type CheckUserAccessTokenArg

type CheckUserAccessTokenArg struct {
	Client      *resty.Client `json:"-"`
	Domain      string        `json:"domain"`
	AccessToken string        `json:"accessToken"`
	OpenId      string        `json:"openId"`
}

type CheckUserAccessTokenReply

type CheckUserAccessTokenReply struct {
	Valid bool `json:"valid"`
}

func CheckUserAccessToken

func CheckUserAccessToken(arg *CheckUserAccessTokenArg) (reply *CheckUserAccessTokenReply, err error)

type GetAccessTokenArg

type GetAccessTokenArg struct {
	Client *resty.Client
	Domain string
	AppId  string
	Secret string
}

type GetAccessTokenReply

type GetAccessTokenReply struct {
	AccessToken string `json:"access_token,omitempty"`
	ExpiresIn   int64  `json:"expires_in,omitempty"`
}

func GetAccessToken

func GetAccessToken(arg *GetAccessTokenArg) (reply *GetAccessTokenReply, err error)

type GetAuthUrlArg

type GetAuthUrlArg struct {
	AppId       string `json:"appId"`
	RedirectUri string `json:"redirectUri"`
	Scope       string `json:"scope"`
	State       string `json:"state"`
}

type GetAuthUrlReply

type GetAuthUrlReply struct {
	Url string `json:"url"`
}

func GetAuthUrl

func GetAuthUrl(arg *GetAuthUrlArg) (*GetAuthUrlReply, error)

type GetUserAccessTokenArg

type GetUserAccessTokenArg struct {
	Client *resty.Client `json:"-"`
	Domain string        `json:"domain,omitempty"`
	AppId  string        `json:"appId,omitempty"`
	Secret string        `json:"secret,omitempty"`
	Code   string        `json:"code,omitempty"`
}

type GetUserAccessTokenReply

type GetUserAccessTokenReply struct {
	AccessToken  string `json:"accessToken"`
	ExpiresIn    int64  `json:"expiresIn"`
	RefreshToken string `json:"refreshToken"`
	OpenId       string `json:"openId"`
	Scope        string `json:"scope"`
}

func GetUserAccessToken

func GetUserAccessToken(arg *GetUserAccessTokenArg) (reply *GetUserAccessTokenReply, err error)

type GetUserInfoArg

type GetUserInfoArg struct {
	Client      *resty.Client `json:"-"`
	Domain      string        `json:"domain"`
	AccessToken string        `json:"accessToken"`
	OpenId      string        `json:"openId"`
}

type GetUserInfoReply

type GetUserInfoReply struct {
	OpenId     string `json:"openId"`
	Nickname   string `json:"nickname"`
	HeadImgUrl string `json:"headImgUrl"`
	UnionId    string `json:"unionId"`
}

func GetUserInfo

func GetUserInfo(arg *GetUserInfoArg) (reply *GetUserInfoReply, err error)

type RefreshUserAccessTokenArg

type RefreshUserAccessTokenArg struct {
	Client       *resty.Client `json:"-"`
	Domain       string        `json:"domain"`
	AppId        string        `json:"appId"`
	RefreshToken string        `json:"refreshToken"`
}

type RefreshUserAccessTokenReply

type RefreshUserAccessTokenReply struct {
	AccessToken  string `json:"accessToken"`
	ExpiresIn    int64  `json:"expiresIn"`
	RefreshToken string `json:"refreshToken"`
	OpenId       string `json:"openId"`
	Scope        string `json:"scope"`
}

func RefreshUserAccessToken

func RefreshUserAccessToken(arg *RefreshUserAccessTokenArg) (reply *RefreshUserAccessTokenReply, err error)

Jump to

Keyboard shortcuts

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