Documentation
¶
Index ¶
- func DecodeNote(ctx context.Context, cfg config.Config, opts Options, noteID string) (NoteDocument, SnapshotInfo, error)
- func DecodeZData(data []byte) (string, error)
- func NewAuditInventory(cfg config.Config, opts Options) audit.UpstreamInventory
- func PlatformSupported() bool
- func ReadDocuments(ctx context.Context, cfg config.Config, opts Options) ([]NoteDocument, SnapshotInfo, error)
- type Attachment
- type NoteDocument
- type Options
- type ProbeStats
- type ProgressEvent
- type ProgressFunc
- type SnapshotInfo
- type Stats
- type TableProbe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeNote ¶
func DecodeNote(ctx context.Context, cfg config.Config, opts Options, noteID string) (NoteDocument, SnapshotInfo, error)
func DecodeZData ¶
func NewAuditInventory ¶ added in v0.7.0
func NewAuditInventory(cfg config.Config, opts Options) audit.UpstreamInventory
NewAuditInventory returns a read-only Apple Notes inventory. It snapshots the live Notes SQLite triplet and never inspects attachment rows or files.
func PlatformSupported ¶
func PlatformSupported() bool
func ReadDocuments ¶
func ReadDocuments(ctx context.Context, cfg config.Config, opts Options) ([]NoteDocument, SnapshotInfo, error)
Types ¶
type Attachment ¶
type Attachment struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ContentID string `json:"content_id,omitempty"`
URL string `json:"url,omitempty"`
FileName string `json:"file_name,omitempty"`
FilePath string `json:"file_path,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
UTI string `json:"uti,omitempty"`
ByteSize int64 `json:"byte_size,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Text string `json:"text,omitempty"`
ExtractStatus string `json:"extract_status,omitempty"`
ExtractTool string `json:"extract_tool,omitempty"`
ExtractedAt string `json:"extracted_at,omitempty"`
ExtractError string `json:"extract_error,omitempty"`
BlockedReason string `json:"blocked_reason,omitempty"`
Raw map[string]any `json:"raw,omitempty"`
}
type NoteDocument ¶
type NoteDocument struct {
SourceKey string `json:"source_key"`
ExternalID string `json:"external_id"`
CanonicalURL string `json:"canonical_url"`
Title string `json:"title"`
Text string `json:"text"`
Snippet string `json:"snippet,omitempty"`
AccountName string `json:"account_name,omitempty"`
FolderPath string `json:"folder_path,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
PasswordProtected bool `json:"password_protected"`
Deleted bool `json:"deleted"`
BlockedReason string `json:"blocked_reason,omitempty"`
Links []string `json:"links,omitempty"`
AppleNoteTags []string `json:"apple_note_tags,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
AttachmentTexts []string `json:"attachment_texts,omitempty"`
Raw map[string]any `json:"raw,omitempty"`
}
type Options ¶
type Options struct {
DBPath string
SnapshotDir string
KeepSnapshot bool
Limit int
DryRun bool
ShowTitles bool
Force bool
SkipAttachments bool
SkipAttachmentOCR bool
AttachmentMaxBytes int64
TesseractBinary string
ExcludeFolders []string
ExcludeAccounts []string
IncludeLocked bool
ForgetExcluded bool
Summarize bool
SummaryModel string
SummaryCLI string
SummaryLength string
Timeout time.Duration
Progress ProgressFunc
}
type ProbeStats ¶
type ProbeStats struct {
SourceDBPath string `json:"source_db_path"`
Snapshot SnapshotInfo `json:"snapshot"`
Tables map[string]TableProbe `json:"tables"`
NoteCount int `json:"note_count"`
AccountCount int `json:"account_count"`
FolderCount int `json:"folder_count"`
Warnings []string `json:"warnings,omitempty"`
Duration time.Duration `json:"duration"`
}
type ProgressEvent ¶
type ProgressEvent struct {
Phase string `json:"phase"`
Index int `json:"index,omitempty"`
Total int `json:"total,omitempty"`
SourceKey string `json:"source_key,omitempty"`
Title string `json:"title,omitempty"`
Status string `json:"status,omitempty"`
Reason string `json:"reason,omitempty"`
Links int `json:"links,omitempty"`
Attachments int `json:"attachments,omitempty"`
TextChars int `json:"text_chars,omitempty"`
AttachmentChars int `json:"attachment_chars,omitempty"`
Rendered bool `json:"rendered,omitempty"`
SummaryStatus string `json:"summary_status,omitempty"`
SummaryChanged bool `json:"summary_changed,omitempty"`
}
type ProgressFunc ¶
type ProgressFunc func(ProgressEvent)
type SnapshotInfo ¶
type SnapshotInfo struct {
SourceDBPath string `json:"source_db_path"`
Dir string `json:"dir"`
DBPath string `json:"db_path"`
CopiedFiles []string `json:"copied_files"`
Kept bool `json:"kept"`
}
func CreateSnapshot ¶
func CreateSnapshot(cfg config.Config, opts Options) (SnapshotInfo, snapshotCleanup, error)
func CreateSnapshotContext ¶ added in v0.7.0
func CreateSnapshotContext(ctx context.Context, cfg config.Config, opts Options) (SnapshotInfo, snapshotCleanup, error)
CreateSnapshotContext copies the live Notes SQLite triplet into a private snapshot and permits cancellation between copy chunks.
type Stats ¶
type Stats struct {
SourceDBPath string `json:"source_db_path"`
Snapshot SnapshotInfo `json:"snapshot"`
NotesSeen int `json:"notes_seen"`
NotesMatched int `json:"notes_matched"`
NotesImported int `json:"notes_imported"`
NotesCreated int `json:"notes_created"`
NotesUpdated int `json:"notes_updated"`
NotesUnchanged int `json:"notes_unchanged"`
NotesRendered int `json:"notes_rendered"`
NotesSkipped int `json:"notes_skipped"`
NotesBlocked int `json:"notes_blocked"`
NotesPurged int `json:"notes_purged"`
ExcludedAccounts int `json:"excluded_accounts"`
ExcludedFolders int `json:"excluded_folders"`
BlockedLocked int `json:"blocked_locked"`
BlockedEmpty int `json:"blocked_empty"`
AttachmentsSeen int `json:"attachments_seen"`
AttachmentsIndexed int `json:"attachments_indexed"`
AttachmentsExtracted int `json:"attachments_extracted"`
AttachmentsOCRed int `json:"attachments_ocred"`
AttachmentsBlocked int `json:"attachments_blocked"`
LinksDiscovered int `json:"links_discovered"`
SummariesCreated int `json:"summaries_created"`
SummaryErrors int `json:"summary_errors"`
SampleTitles []string `json:"sample_titles,omitempty"`
DryRun bool `json:"dry_run"`
Applied bool `json:"applied"`
Errors int `json:"errors"`
}
type TableProbe ¶
Source Files
¶
- attachment_copy.go
- attachment_extract.go
- attachment_kind.go
- attachment_ocr.go
- attachment_state.go
- attachments.go
- decoder.go
- document_types.go
- inventory.go
- materialize.go
- progress.go
- purge.go
- reader.go
- reader_attachment_paths.go
- reader_attachment_rows.go
- reader_db.go
- reader_document.go
- reader_text.go
- reader_values.go
- run.go
- run_apply.go
- run_setup.go
- snapshot.go
- snapshot_db.go
- snapshot_files.go
- snapshot_types.go
- stats.go
- summary.go
- types.go
- work_plan.go