Documentation
¶
Overview ¶
Package token 基于 golang.org/x/oauth2 标准实现token source
Index ¶
Constants ¶
View Source
const ( // TypeBearer .. TypeBearer string = "Bearer" // TypeQQBot .. TypeQQBot string = "QQBot" )
Variables ¶
This section is empty.
Functions ¶
func NewQQBotTokenSource ¶ added in v0.1.7
func NewQQBotTokenSource(credentials *QQBotCredentials) oauth2.TokenSource
NewQQBotTokenSource 初始化
func StartRefreshAccessToken ¶ added in v0.1.7
func StartRefreshAccessToken(ctx context.Context, tokenSource oauth2.TokenSource) error
StartRefreshAccessToken 启动获取AccessToken的后台刷新
Types ¶
type QQBotCredentials ¶ added in v0.1.7
QQBotCredentials QQ机器人appid、secret
type QQBotTokenSource ¶ added in v0.1.7
type QQBotTokenSource struct {
// contains filtered or unexported fields
}
QQBotTokenSource QQ机器人token source
func (*QQBotTokenSource) GetAppID ¶ added in v0.1.7
func (w *QQBotTokenSource) GetAppID() string
GetAppID 获取appid
Click to show internal directories.
Click to hide internal directories.