Documentation
¶
Index ¶
- Constants
- type GDriveWorker
- func (w *GDriveWorker) ExtractContent(ctx context.Context, file *db.File) (string, error)
- func (w *GDriveWorker) Name() string
- func (w *GDriveWorker) SetDryRun(dryRun bool)
- func (w *GDriveWorker) Start(ctx context.Context) error
- func (w *GDriveWorker) Stop() error
- func (w *GDriveWorker) Sync(ctx context.Context) error
- type GogClient
- type OCRClient
Constants ¶
View Source
const ( MimeGoogleDoc = "application/vnd.google-apps.document" MimeGoogleSheet = "application/vnd.google-apps.spreadsheet" MimeGoogleSlide = "application/vnd.google-apps.presentation" MimePDF = "application/pdf" MimeMSWord = "application/vnd.openxmlformats-officedocument.wordprocessingml.document" MimeMSExcel = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" MimeMSPowerPoint = "application/vnd.openxmlformats-officedocument.presentationml.presentation" MimeMarkdown = "text/markdown" MimePlain = "text/plain" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GDriveWorker ¶
type GDriveWorker struct {
DryRun bool
// contains filtered or unexported fields
}
GDriveWorker implements the worker interface for Google Drive synchronization.
func (*GDriveWorker) ExtractContent ¶
ExtractContent retrieves the content of a Google Drive file and returns it as Markdown.
func (*GDriveWorker) SetDryRun ¶
func (w *GDriveWorker) SetDryRun(dryRun bool)
SetDryRun sets the dry-run mode for the worker.
func (*GDriveWorker) Start ¶
func (w *GDriveWorker) Start(ctx context.Context) error
Start begins the synchronization loop. It performs an initial sync and then schedules periodic syncs based on the configuration.
func (*GDriveWorker) Stop ¶
func (w *GDriveWorker) Stop() error
Stop gracefully shuts down the worker.
type GogClient ¶
type GogClient interface {
DriveLs(ctx context.Context, parentID string) ([]gog.File, error)
DriveSearch(ctx context.Context, query string) ([]gog.File, error)
SheetsGetValues(ctx context.Context, sheetID string, cellRange string) ([][]string, error)
SheetsUpdate(ctx context.Context, sheetID string, cellRange string, values [][]string) error
SheetsAppend(ctx context.Context, sheetID string, cellRange string, values [][]string) error
DocsCat(ctx context.Context, fileID string) (string, error)
SheetsGet(ctx context.Context, sheetID string) (string, error)
SheetsMetadata(ctx context.Context, sheetID string) (*gog.SpreadsheetMetadata, error)
DriveDownload(ctx context.Context, fileID string, format string) ([]byte, error)
DriveDownloadToFile(ctx context.Context, fileID string, format string, outputPath string) error
}
GogClient defines the interface for Google Drive operations needed by the worker.
Click to show internal directories.
Click to hide internal directories.