internal

package
v0.0.0-...-d328114 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 5 Imported by: 0

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

func DumpResponse(tag string) opt.Option

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

Jump to

Keyboard shortcuts

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