Documentation ¶
Index ¶
- Constants
- func GetFileIdAndTypeFromUrl(url string) (string, string)
- func GetOAuthUrl(config *oauth2.Config) string
- func ParseConfigFromClientJson(credsJson []byte) (*oauth2.Config, error)
- func ParseTokenJson(tokenJson []byte) (*oauth2.Token, error)
- func ProcessAuthCode(ctx context.Context, authCode string, config *oauth2.Config) (*oauth2.Token, error)
- func ProcessPostText(postBodyStr, postFolderPath string, downloadGdrive bool, logUrls bool) []*httpfuncs.ToDownload
- func StartOAuthListener(ctx context.Context, config *oauth2.Config) (*oauth2.Token, error)
- type CredsInputs
- type GDrive
- func (gdrive *GDrive) DownloadFile(ctx context.Context, fileInfo *GdriveFileToDl, filePath string, ...) error
- func (gdrive *GDrive) DownloadGdriveUrls(gdriveUrls []*httpfuncs.ToDownload, progBarInfo *progress.ProgressBarInfo) []error
- func (gdrive *GDrive) DownloadMultipleFiles(files []*GdriveFileToDl, progBarInfo *progress.ProgressBarInfo) []error
- func (gdrive *GDrive) GetFileDetails(gdriveInfo *GDriveToDl) (*GdriveFileToDl, error)
- func (gdrive *GDrive) GetFolderContents(folderId, logPath string) ([]*GdriveFileToDl, error)
- func (gdrive *GDrive) GetNestedFolderContents(folderId, logPath string) ([]*GdriveFileToDl, error)
- func (gdrive *GDrive) Release()
- type GDriveToDl
- type GdriveError
- type GdriveFileToDl
Constants ¶
const USE_DEFAULT_MAX_CONCURRENCY = -1
Variables ¶
This section is empty.
Functions ¶
func GetFileIdAndTypeFromUrl ¶
Uses regex to extract the file ID and the file type (type: file, folder) from the given URL
func GetOAuthUrl ¶ added in v1.1.0
func ParseConfigFromClientJson ¶ added in v1.1.0
func ProcessAuthCode ¶ added in v1.1.0
func ProcessPostText ¶
func ProcessPostText(postBodyStr, postFolderPath string, downloadGdrive bool, logUrls bool) []*httpfuncs.ToDownload
Process and detects for any external download links from the post's text content
Types ¶
type CredsInputs ¶ added in v1.1.0
type GDrive ¶
type GDrive struct {
// contains filtered or unexported fields
}
func GetNewGDrive ¶ added in v1.1.0
func GetNewGDrive(ctx context.Context, creds *CredsInputs, maxDownloadWorkers int, useCacheDb bool) (*GDrive, error)
Returns a GDrive structure with the given API key and max download workers
func (*GDrive) DownloadFile ¶
func (gdrive *GDrive) DownloadFile(ctx context.Context, fileInfo *GdriveFileToDl, filePath string, progBarInfo *progress.ProgressBarInfo, queue chan struct{}) error
Downloads the given GDrive file using GDrive API v3
If the md5Checksum has a mismatch, the file will be overwritten and downloaded again Downloads the given GDrive file using GDrive API v3
If the md5Checksum has a mismatch, the file will be overwritten and downloaded again
func (*GDrive) DownloadGdriveUrls ¶
func (gdrive *GDrive) DownloadGdriveUrls(gdriveUrls []*httpfuncs.ToDownload, progBarInfo *progress.ProgressBarInfo) []error
Downloads multiple GDrive files based on a slice of GDrive URL strings in parallel
func (*GDrive) DownloadMultipleFiles ¶
func (gdrive *GDrive) DownloadMultipleFiles(files []*GdriveFileToDl, progBarInfo *progress.ProgressBarInfo) []error
Downloads the multiple GDrive file in parallel using GDrive API v3
func (*GDrive) GetFileDetails ¶
func (gdrive *GDrive) GetFileDetails(gdriveInfo *GDriveToDl) (*GdriveFileToDl, error)
Retrieves the file details of the given GDrive file using GDrive API v3
func (*GDrive) GetFolderContents ¶
func (gdrive *GDrive) GetFolderContents(folderId, logPath string) ([]*GdriveFileToDl, error)
Returns the contents of the given GDrive folder
func (*GDrive) GetNestedFolderContents ¶
func (gdrive *GDrive) GetNestedFolderContents(folderId, logPath string) ([]*GdriveFileToDl, error)
Retrieves the content of a GDrive folder and its subfolders recursively using GDrive API v3