Documentation
¶
Overview ¶
Package sync provides Gmail synchronization workflows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHistoryExpired = errors.New("history expired - run full sync")
ErrHistoryExpired indicates that the Gmail history ID is too old and a full sync is required.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Query is an optional Gmail search query (e.g., "before:2020/01/01")
Query string
// NoResume forces a fresh sync even if a checkpoint exists
NoResume bool
// BatchSize is the number of messages to fetch in parallel (default: 10)
BatchSize int
// CheckpointInterval is how often to save progress (default: every 200 messages)
CheckpointInterval int
// AttachmentsDir is where to store attachments
AttachmentsDir string
// Limit caps the number of messages scanned per sync (0 = unlimited).
// Enforced by truncating the message ID list before downloading content.
// The API listing call (which returns lightweight IDs, not bodies) may
// return more IDs than the limit; only the truncated set is fetched.
Limit int
}
Options configures sync behavior.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer performs Gmail synchronization.
func (*Syncer) Incremental ¶
Incremental performs an incremental sync using the Gmail History API. Falls back to full sync if history is too old (404 error).
func (*Syncer) WithLogger ¶
WithLogger sets the logger.
func (*Syncer) WithProgress ¶
func (s *Syncer) WithProgress(p gmail.SyncProgress) *Syncer
WithProgress sets the progress reporter.
Click to show internal directories.
Click to hide internal directories.