Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IdTypeModuleApiId = module_id.IdType("module_api:id")
Functions ¶
func RegisterPlatform ¶
func RegisterPlatform(platform *Platform)
Types ¶
type GetAccessTokenFunc ¶
type IOauthAccessTokenCache ¶
type IOauthAccessTokenCache interface {
Add(data *OauthAccessToken)
Get(name string) (res *OauthAccessToken)
GetIfPresent(name string) (res *OauthAccessToken)
}
type IOauthAccessTokenStorage ¶
type IOauthAccessTokenStorage interface {
GetByName(name string) (res *OauthAccessToken, err error)
Insert(in *OauthAccessToken) (res int64, err error)
Update(in *OauthAccessToken) (res int64, err error)
UpdateAccessToken(name string, accessToken string, expiresIn int64, expiresAt int64) (res int64, err error)
Query(in *OauthAccessToken) (res []*OauthAccessToken, err error)
Page(in *OauthAccessToken, pageNo int64, pageSize int64) (res []*OauthAccessToken, err error)
DeleteByName(name string) (res int64, err error)
}
type OauthAccessToken ¶
type OauthAccessToken struct {
Name string `json:"name" column:"name"`
PlatformType string `json:"platformType" column:"platform_type"`
OauthUrl string `json:"oauthUrl" column:"oauth_url"`
AppId string `json:"appId" column:"app_id"`
AppSecret string `json:"appSecret" column:"app_secret"`
Extends string `json:"extends" column:"extends"`
AccessToken string `json:"accessToken" column:"access_token"`
ExpiresIn int64 `json:"expiresIn" column:"expires_in"`
ExpiresAt int64 `json:"expiresAt" column:"expires_at"`
Status int `json:"status" column:"status"`
CreatedAt int64 `json:"createdAt" column:"created_at"`
UpdatedAt int64 `json:"updatedAt" column:"updated_at"`
}
func (*OauthAccessToken) GetPrimaryKey ¶
func (this_ *OauthAccessToken) GetPrimaryKey() []string
func (*OauthAccessToken) GetTableName ¶
func (this_ *OauthAccessToken) GetTableName() string
type OauthInfo ¶
type OauthInfo struct {
AccessToken string `json:"accessToken"`
// ExpiresIn 有效期(秒),部分平台可能返回时间戳,业务层转换后存储
ExpiresIn int64 `json:"expiresIn"`
}
func GetAccessToken ¶
type Platform ¶
type Platform struct {
Type string `json:"type,omitempty"`
// contains filtered or unexported fields
}
func GetPlatform ¶
func (*Platform) SetGetAccessToken ¶
func (this_ *Platform) SetGetAccessToken(getAccessToken GetAccessTokenFunc) *Platform
Click to show internal directories.
Click to hide internal directories.