Documentation ¶
Index ¶
Constants ¶
View Source
const ( DuFaceServiceAuthUrl = `https://aip.baidubce.com/oauth/2.0` DuFaceBusinessUrlV3 = `https://aip.baidubce.com/rest/2.0/face/v3` )
Variables ¶
This section is empty.
Functions ¶
func DumpResponse ¶
Types ¶
type ObtainTokenResponse ¶
type ObtainTokenResponse struct { RefreshToken string `json:"refresh_token"` ExpireIn int64 `json:"expires_in"` Scope string `json:"scope"` SessionKey string `json:"session_key"` AccessToken string `json:"access_token"` SessionSecret string `json:"session_secret"` }
access_token: 要获取的 Access Token; expires_in: Access Token 的有效期 (秒为单位,一般为 1 个月); 其他参数忽略,暂时不用 ;
type TimedAccessToken ¶
type TimedAccessToken struct { AccessToken string ExpireAt time.Time AheadTimeout time.Duration // 提前超时时间 }
func NewAccessTokenInfo ¶
func NewAccessTokenInfo(token string, expireIn int64, aheadTimeout time.Duration) *TimedAccessToken
func (*TimedAccessToken) IsExpired ¶
func (this *TimedAccessToken) IsExpired() bool
Click to show internal directories.
Click to hide internal directories.