Documentation ¶
Index ¶
- Constants
- func GetAllScope() string
- func GetInteractScope() string
- func GetUserScope() string
- func GetVideoScope() string
- type Oauth
- func (oauth *Oauth) GetRedirectURL(state string) string
- func (oauth *Oauth) GetSilenceOauthURL(state string) string
- func (oauth *Oauth) GetUserAccessToken(code string) (accessToken credential.AccessToken, err error)
- func (oauth *Oauth) RefreshAccessToken(refreshToken string) (accessToken credential.AccessToken, err error)
- func (oauth *Oauth) RenewRefreshToken(refreshToken string) (refreshTokenData credential.RefreshToken, err error)
Constants ¶
View Source
const ( // ScopeUserInfo 获取用户公开信息 ScopeUserInfo = "user_info" // ScopeFansList 粉丝列表 ScopeFansList = "fans.list" // ScopeFollowingList 关注列表 ScopeFollowingList = "following.list" // ScopeFansData 查询创作者粉丝数据 ScopeFansData = "fans.data" // ScopeVideoCreate 上传视频到文件服务器 - 创建抖音视频 -上传图片到文件服务器 - 发布图片 ScopeVideoCreate = "video.create" // ScopeVideoList 列出已发布的视频 ScopeVideoList = "video.list" // ScopeVideoData 查询指定视频数据 ScopeVideoData = "video.data" ScopeAwemeshare = "aweme.share" // ScopeVideoDelete 删除抖音视频 ScopeVideoDelete = "video.delete" // ScopeHotsearch 获取实时热点词 --获取热点词聚合的视频 ScopeHotsearch = "hotsearch" // ScopeVideoComment 评论列表 ---评论回复列表 ---回复视频评论 ---置顶视频评论(企业号) ScopeVideoComment = "video.comment" // ScopeIm 给抖音用户发送消息 --- 上传素材 ScopeIm = "im" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Oauth ¶
Oauth 保存用户授权信息
func (*Oauth) GetRedirectURL ¶
GetRedirectURL 获取授权码的url地址
func (*Oauth) GetSilenceOauthURL ¶
GetSilenceOauthURL 获取静默授权码的url地址
func (*Oauth) GetUserAccessToken ¶
func (oauth *Oauth) GetUserAccessToken(code string) (accessToken credential.AccessToken, err error)
GetUserAccessToken 通过网页授权的code 换取access_token
func (*Oauth) RefreshAccessToken ¶
func (oauth *Oauth) RefreshAccessToken(refreshToken string) (accessToken credential.AccessToken, err error)
RefreshAccessToken 刷新AccessToken. 当access_token过期(过期时间15天)后,可以通过该接口使用refresh_token(过期时间30天)进行刷新
func (*Oauth) RenewRefreshToken ¶
func (oauth *Oauth) RenewRefreshToken(refreshToken string) (refreshTokenData credential.RefreshToken, err error)
RenewRefreshToken 刷新refresh_token. 前提: client_key需要具备renew_refresh_token这个权限 接口说明: 可以通过旧的refresh_token获取新的refresh_token,调用后旧refresh_token会失效,新refresh_token有30天有效期。最多只能获取5次新的refresh_token,5次过后需要用户重新授权。
Click to show internal directories.
Click to hide internal directories.