app

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProxyURL = "https://open-anubis.ele.me/anubis-webapi/v3/invoke/"

可配置沙箱环境: https://exam-anubis.ele.me/anubis-webapi/v3/invoke/

View Source
const MaxTokenLifeSpan = time.Minute * 8

token刷新接口10分钟有效期,如果10分钟内多次调用, 只有第一次会刷新access_token和refresh_token, 后续调用会返回第一次刷新的access_token和refresh_token。 所以需要保证token缓存有效期在10分钟内。

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCallbackRequest

type AuthCallbackRequest struct {
	Code       string `json:"code"`
	MerchantId string `json:"merchant_id"`
	Scope      string `json:"scope"`
	State      string `json:"state"`
}

type CallbackRequest

type CallbackRequest struct {
	AppId        string `json:"app_id"`
	Timestamp    string `json:"timestamp"`
	Signature    string `json:"signature"`
	BusinessData string `json:"business_data"`
}

type Config

type Config struct {
	FengniaoAppTokenURL       string
	FengniaoAppRefreshURL     string
	FengniaoAppConfigLifeSpan gokits.Duration
	FengniaoAppTokenLifeSpan  gokits.Duration
	FengniaoAppProxyURL       string
}

type FengniaoAppConfig

type FengniaoAppConfig struct {
	DevId       string
	AppId       string
	AppSecret   string
	CallbackURL string
}

type FengniaoAppToken

type FengniaoAppToken struct {
	AppId       string `json:"appId"`
	MerchantId  string `json:"merchantId"`
	AccessToken string `json:"token"`
}

type FengniaoAppTokenKey

type FengniaoAppTokenKey struct {
	CodeName   string
	MerchantId string
}

type QueryFengniaoAppToken

type QueryFengniaoAppToken struct {
	FengniaoAppToken
	ExpireTime   int64
	RefreshToken string
	ReExpireTime int64
}

type Response

type Response struct {
	Sign string               `json:"sign"`
	Code string               `json:"code"`
	Msg  string               `json:"msg"`
	Data ResponseBusinessData `json:"business_data"`
}

type ResponseBusinessData

type ResponseBusinessData struct {
	AppId        string `json:"app_id"`
	MerchantId   string `json:"merchant_id"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpireIn     string `json:"expire_in"`
	ReExpireIn   string `json:"re_expire_in"`
}

Jump to

Keyboard shortcuts

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