syncjob

package
v0.8.16 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitRunCompleted added in v0.8.8

func EmitRunCompleted(run metrics.RunContext, stats Stats, runErr error)

EmitRunCompleted records the terminal boundary for the full sync execution. Callers that set Options.ParentOwnsRunCompletion must invoke this after their attached work settles.

func WrapStageError added in v0.8.4

func WrapStageError(stage string, cause error) error

WrapStageError records a known sync stage without changing the cause's text. Unknown stages are returned unchanged rather than gaining unstable identity.

Types

type AppleNotesStage

type AppleNotesStage struct {
	Duration time.Duration    `json:"duration"`
	Stats    applenotes.Stats `json:"stats"`
}

type BlueskyBookmarksStage added in v0.8.12

type BlueskyBookmarksStage struct {
	Duration time.Duration         `json:"duration"`
	Stats    bskyapi.BookmarkStats `json:"stats"`
}

type CategorizeStage

type CategorizeStage struct {
	Duration    time.Duration        `json:"duration"`
	Stats       itemcategorize.Stats `json:"stats"`
	ItemStats   itemcategorize.Stats `json:"item_stats"`
	SourceStats itemcategorize.Stats `json:"source_stats"`
}

type FeedsStage added in v0.1.6

type FeedsStage struct {
	Duration time.Duration    `json:"duration"`
	Stats    feedimport.Stats `json:"stats"`
}

type GitHubStage

type GitHubStage struct {
	Duration time.Duration      `json:"duration"`
	Stats    githubimport.Stats `json:"stats"`
}

type LinksStage

type LinksStage struct {
	Duration time.Duration     `json:"duration"`
	Stats    linkextract.Stats `json:"stats"`
}

type MastodonBookmarksStage added in v0.8.12

type MastodonBookmarksStage struct {
	Duration time.Duration               `json:"duration"`
	Stats    mastodonapi.BookmarkStats   `json:"stats"`
	Accounts []mastodonapi.BookmarkStats `json:"accounts,omitempty"`
}

type MediaArchiveStage

type MediaArchiveStage struct {
	Duration time.Duration      `json:"duration"`
	Stats    mediaarchive.Stats `json:"stats"`
}

type OKFExportStage added in v0.2.17

type OKFExportStage struct {
	Duration time.Duration    `json:"duration"`
	Stats    okf.ExportResult `json:"stats"`
}

type Options

type Options struct {
	XBookmarksEnabled        bool
	XBookmarksLimit          int
	BlueskyBookmarksEnabled  bool
	BlueskyBookmarksLimit    int
	BlueskyBookmarksTimeout  time.Duration
	MastodonBookmarksEnabled bool
	MastodonBookmarksLimit   int
	MastodonBookmarksTimeout time.Duration

	XEnabled         bool
	XLimit           int
	XConcurrency     int
	XTimeout         time.Duration
	XMediaTimeout    time.Duration
	XMediaEnabled    bool
	XMediaLimit      int
	XPhotoOCREnabled bool
	XPhotoOCRLimit   int

	LinksEnabled      bool
	LinkDiscoverLimit int
	LinkLimit         int
	LinkConcurrency   int

	GitHubEnabled bool
	GitHubLimit   int

	YouTubeEnabled bool
	YouTubeLimit   int
	WatchLater     bool
	Liked          bool

	AppleNotesEnabled            bool
	AppleNotesDBPath             string
	AppleNotesLimit              int
	AppleNotesExcludeFolders     []string
	AppleNotesExcludeAccounts    []string
	AppleNotesExcludeShared      bool
	AppleNotesIncludeLocked      bool
	AppleNotesSkipAttachments    bool
	AppleNotesSkipAttachmentOCR  bool
	AppleNotesAttachmentMaxBytes int64
	AppleNotesTesseractBinary    string

	SafariTabsEnabled   bool
	SafariTabsDBPath    string
	SafariTabsDevice    string
	SafariTabsLimit     int
	SafariTabsOlderThan time.Duration

	FeedsEnabled bool
	FeedLimit    int

	SourcesEnabled      bool
	SourceLimit         int
	SourceConcurrency   int
	SourceWatch         bool
	SourcePollInterval  time.Duration
	SourceIdleExitAfter time.Duration
	SourceMaxCycles     int

	Browser                 string
	Profile                 string
	Force                   bool
	Summarize               bool
	Model                   string
	OCRModel                string
	ArchiveMediaEnabled     bool
	ArchiveMediaLimit       int
	ArchiveProvider         string
	ArchiveBucket           string
	ArchivePublicBaseURL    string
	ArchiveEndpoint         string
	ArchiveRegion           string
	ArchiveAccessKeyID      string
	ArchiveSecretKey        string
	ArchiveSessionToken     string
	CategorizeEnabled       bool
	CategorizeLimit         int
	CategorizeConcurrency   int
	CategorizeModel         string
	CategorizeTimeout       time.Duration
	CategorizeImages        bool
	OKFExportEnabled        bool
	OKFMediaProxyBaseURL    string
	CLI                     string
	Length                  string
	Timeout                 time.Duration
	Logger                  *slog.Logger
	Progress                io.Writer
	Metrics                 metrics.RunContext
	ParentOwnsRunCompletion bool
}

type SafariTabsStage

type SafariTabsStage struct {
	Duration time.Duration    `json:"duration"`
	Stats    safaritabs.Stats `json:"stats"`
}

type SourcesStage

type SourcesStage struct {
	Duration time.Duration      `json:"duration"`
	Stats    worker.SourceStats `json:"stats"`
}

type StageError added in v0.8.4

type StageError struct {
	// contains filtered or unexported fields
}

StageError preserves the sync stage that produced a fatal error while retaining the original error text and unwrap chain.

func (*StageError) Error added in v0.8.4

func (e *StageError) Error() string

func (*StageError) Stage added in v0.8.4

func (e *StageError) Stage() string

func (*StageError) Unwrap added in v0.8.4

func (e *StageError) Unwrap() error

type Stats

type Stats struct {
	StartedAt         time.Time               `json:"started_at"`
	CompletedAt       time.Time               `json:"completed_at,omitempty"`
	Duration          time.Duration           `json:"duration"`
	XBookmarks        *XBookmarksStage        `json:"x_bookmarks,omitempty"`
	BlueskyBookmarks  *BlueskyBookmarksStage  `json:"bluesky_bookmarks,omitempty"`
	MastodonBookmarks *MastodonBookmarksStage `json:"mastodon_bookmarks,omitempty"`
	X                 *XStage                 `json:"x,omitempty"`
	XMedia            *XMediaStage            `json:"x_media,omitempty"`
	XPhotoOCR         *XPhotoOCRStage         `json:"x_photo_ocr,omitempty"`
	Links             *LinksStage             `json:"links,omitempty"`
	GitHub            *GitHubStage            `json:"github,omitempty"`
	YouTube           *YouTubeStage           `json:"youtube,omitempty"`
	AppleNotes        *AppleNotesStage        `json:"apple_notes,omitempty"`
	SafariTabs        *SafariTabsStage        `json:"safari_tabs,omitempty"`
	Feeds             *FeedsStage             `json:"feeds,omitempty"`
	Sources           *SourcesStage           `json:"sources,omitempty"`
	MediaArchive      *MediaArchiveStage      `json:"media_archive,omitempty"`
	Categorize        *CategorizeStage        `json:"categorize,omitempty"`
	OKFExport         *OKFExportStage         `json:"okf_export,omitempty"`
}

func Run

func Run(ctx context.Context, cfg config.Config, st *store.Store, opts Options) (Stats, error)

type XBookmarksStage

type XBookmarksStage struct {
	Duration time.Duration      `json:"duration"`
	Stats    xapi.BookmarkStats `json:"stats"`
}

type XMediaStage

type XMediaStage struct {
	Duration time.Duration          `json:"duration"`
	Stats    xmediatranscribe.Stats `json:"stats"`
}

type XPhotoOCRStage

type XPhotoOCRStage struct {
	Duration time.Duration   `json:"duration"`
	Stats    xphotoocr.Stats `json:"stats"`
}

type XStage

type XStage struct {
	Duration time.Duration `json:"duration"`
	Stats    xapi.Stats    `json:"stats"`
}

type YouTubeStage

type YouTubeStage struct {
	Duration time.Duration       `json:"duration"`
	Stats    youtubeimport.Stats `json:"stats"`
}

Jump to

Keyboard shortcuts

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