Documentation ¶
Index ¶
- Constants
- Variables
- func ApiEvent(c echo.Context, kfsCore *core.KFS) error
- func InsertDriverBaiduPhoto(ctx context.Context, kfsCore *core.KFS, name, description, code string) (bool, error)
- type Client
- type DriverBaiduPhoto
- func (d *DriverBaiduPhoto) Analyze(ctx context.Context) (err error)
- func (d *DriverBaiduPhoto) Download(ctx context.Context, file File, hash string) error
- func (d *DriverBaiduPhoto) DownloadFile(ctx context.Context, name string, downloadPath string) (string, error)
- func (d *DriverBaiduPhoto) Get(ctx context.Context, furl string, callback func(req *resty.Request), ...) error
- func (d *DriverBaiduPhoto) GetAllFile(ctx context.Context, cb func([]File) bool) error
- func (d *DriverBaiduPhoto) GetDownloadPath(ctx context.Context, fsid int64) (string, error)
- func (d *DriverBaiduPhoto) Request(ctx context.Context, furl string, method string, ...) (err error)
- func (d *DriverBaiduPhoto) StartOrStop(ctx context.Context, start bool)
- func (d *DriverBaiduPhoto) WGet(ctx context.Context, furl string, output string) error
- type File
- type FileListResp
- type Page
- type TaskInfo
- type TokenErrResp
- type TokenResp
Constants ¶
View Source
const ( API_URL = "https://photo.baidu.com/youai" USER_API_URL = API_URL + "/user/v1" ALBUM_API_URL = API_URL + "/album/v1" FILE_API_URL_V1 = API_URL + "/file/v1" FILE_API_URL_V2 = API_URL + "/file/v2" )
View Source
const AppKey = "huREKC2eNTctaBWfh3LdiAYjZ9ARBh5g"
View Source
const SecretKey = "eMmhaLDpxzTKX3upCguM0q9yOsmVDP6g"
View Source
const UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
Variables ¶
View Source
var ( StatusIdle = 0 StatusFinished = 1 StatusCanceled = 2 StatusError = 3 StatusWaitRunning = 4 StatusWaitCanceled = 5 StatusRunning = 6 )
View Source
var EmptyToken = errors.New("empty token")
Functions ¶
Types ¶
type DriverBaiduPhoto ¶
type DriverBaiduPhoto struct { AccessToken string RefreshToken string AppKey string SecretKey string // contains filtered or unexported fields }
func GetOrLoadDriver ¶
func LoadDriverFromDb ¶
func (*DriverBaiduPhoto) Analyze ¶
func (d *DriverBaiduPhoto) Analyze(ctx context.Context) (err error)
func (*DriverBaiduPhoto) DownloadFile ¶
func (*DriverBaiduPhoto) Get ¶
func (d *DriverBaiduPhoto) Get(ctx context.Context, furl string, callback func(req *resty.Request), resp interface{}) error
func (*DriverBaiduPhoto) GetAllFile ¶
func (*DriverBaiduPhoto) GetDownloadPath ¶
func (*DriverBaiduPhoto) StartOrStop ¶
func (d *DriverBaiduPhoto) StartOrStop(ctx context.Context, start bool)
type FileListResp ¶
type Page ¶
func (Page) HasNextPage ¶
type TokenErrResp ¶
type TokenErrResp struct { ErrorDescription string `json:"error_description"` ErrorMsg string `json:"error"` }
func (*TokenErrResp) Error ¶
func (e *TokenErrResp) Error() string
Click to show internal directories.
Click to hide internal directories.