Documentation
¶
Index ¶
- Constants
- type ExtractResult
- type Item
- type ItemEnrichment
- type ItemMediaRef
- type ItemSourceRef
- type MediaArchiveResult
- type MediaAsset
- type MediaDownloadResult
- type OCRResult
- type SearchResult
- type SourceBacklink
- type SourceCandidate
- type SourceDocument
- type SourceLinkUpsertResult
- type SourceUpsertResult
- type SummaryResult
- type UpsertResult
- type UpsertStatus
- type XHydration
Constants ¶
const ( ItemEnrichmentRoleSummary = "summary" ItemEnrichmentRoleOCR = "ocr" ItemEnrichmentRoleXMediaTranscript = "x_media_transcript" )
const ( ItemSummaryStatusOK = "ok" ItemSummaryStatusError = "error" ItemSummaryStatusBlocked = "blocked" ItemSummaryStatusSkipped = "skipped" )
const ( ItemOCRStatusOK = "ok" ItemOCRStatusError = "error" ItemOCRStatusBlocked = "blocked" ItemOCRStatusSkipped = "skipped" )
const ( XMediaTranscriptStatusOK = "ok" XMediaTranscriptStatusError = "error" XMediaTranscriptStatusEmpty = "empty" XMediaTranscriptStatusNoise = "noise" XMediaTranscriptStatusTooShort = "too_short" XMediaTranscriptStatusNoAudio = "no_audio" )
const ( MediaDownloadMaxConsecutiveErrors = 3 MediaDownloadRetryCooldown = 24 * time.Hour )
const ( MediaDownloadStatusPending = "pending" MediaDownloadStatusDownloaded = "downloaded" MediaDownloadStatusError = "error" MediaDownloadStatusGone = "gone" MediaDownloadStatusBlocked = "blocked" MediaArchiveStatusArchived = "archived" MediaArchiveStatusError = "error" )
Media download/archive statuses are persisted in SQLite; keep these values stable.
const ( SourceExtractStatusOK = "ok" SourceExtractStatusEmpty = "empty" SourceExtractStatusError = "error" SourceExtractStatusDead = "dead" SourceExtractStatusGone = "gone" )
const ( SourceSummaryStatusOK = "ok" SourceSummaryStatusError = "error" SourceSummaryStatusBlocked = "blocked" SourceSummaryStatusSkipped = "skipped" )
const ( SourceFailureKindUnknown = "unknown" SourceFailureKindFetchFailed = "fetch_failed" SourceFailureKindRateLimited = "rate_limited" SourceFailureKindHTTP5xx = "http_5xx" SourceFailureKindTLSCertificate = "tls_certificate" SourceFailureKindCloudflareEdge = "cloudflare_edge" SourceFailureKindConnectivity = "connectivity" SourceFailureKindXArticleShell = "x_article_shell" SourceFailureKindHTTPAccessDenied = "http_access_denied" SourceFailureKindTimeout = "timeout" SourceFailureKindDNSNXDomain = "dns_nxdomain" SourceFailureKindUnsupportedFile = "unsupported_file" SourceFailureKindHTTPGone = "http_gone" )
const XMediaTranscriptArticleTitle = "X Media Transcript"
Item enrichment status values are persisted in SQLite. Keep these string values stable unless a schema migration intentionally changes them.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtractResult ¶
type Item ¶
type Item struct {
ID int64 `json:"id"`
SourceKey string `json:"source_key"`
SourceType string `json:"source_type"`
ExternalID string `json:"external_id"`
CanonicalURL string `json:"canonical_url"`
Title string `json:"title"`
AuthorHandle string `json:"author_handle"`
AuthorName string `json:"author_name"`
PublishedAt string `json:"published_at"`
SavedAt string `json:"saved_at"`
SyncedAt string `json:"synced_at"`
Language string `json:"language"`
Text string `json:"text"`
ArticleTitle string `json:"article_title"`
ArticleText string `json:"article_text"`
PrimaryCategory string `json:"primary_category"`
PrimaryDomain string `json:"primary_domain"`
LinksJSON string `json:"links_json"`
Categories string `json:"categories"`
Domains string `json:"domains"`
GitHubURLs string `json:"github_urls"`
FolderNames string `json:"folder_names"`
LikeCount int `json:"like_count"`
RepostCount int `json:"repost_count"`
ReplyCount int `json:"reply_count"`
QuoteCount int `json:"quote_count"`
BookmarkCount int `json:"bookmark_count"`
ContentHash string `json:"content_hash"`
NotePath string `json:"note_path"`
RawJSON string `json:"raw_json"`
ImportedAt time.Time `json:"imported_at"`
UpdatedAt time.Time `json:"updated_at"`
LastSeenAt time.Time `json:"last_seen_at"`
XPostText string `json:"x_post_text"`
XPostLang string `json:"x_post_lang"`
XPostJSON string `json:"x_post_json"`
XPostFetchedAt time.Time `json:"x_post_fetched_at"`
XPostStatus string `json:"x_post_status"`
XPostError string `json:"x_post_error"`
LinkExtractSyncedAt time.Time `json:"link_extract_synced_at"`
SummaryText string `json:"summary_text"`
SummaryJSON string `json:"summary_json"`
SummaryStatus string `json:"summary_status"`
SummaryError string `json:"summary_error"`
SummaryModel string `json:"summary_model"`
SummaryPromptVersion string `json:"summary_prompt_version"`
SummaryTool string `json:"summary_tool"`
SummaryToolVersion string `json:"summary_tool_version"`
SummaryInputHash string `json:"summary_input_hash"`
SummarizedAt time.Time `json:"summarized_at"`
OCRText string `json:"ocr_text"`
OCRJSON string `json:"ocr_json"`
OCRStatus string `json:"ocr_status"`
OCRError string `json:"ocr_error"`
OCRModel string `json:"ocr_model"`
OCRTool string `json:"ocr_tool"`
OCRToolVersion string `json:"ocr_tool_version"`
OCRInputHash string `json:"ocr_input_hash"`
OCRAt time.Time `json:"ocr_at"`
XMediaTranscriptStatus string `json:"x_media_transcript_status"`
XMediaTranscriptError string `json:"x_media_transcript_error"`
XMediaTranscriptAt time.Time `json:"x_media_transcript_at"`
UserTags string `json:"user_tags"`
Media []ItemMediaRef `json:"media,omitempty"`
}
type ItemEnrichment ¶
type ItemEnrichment struct {
ID int64 `json:"id"`
ItemID int64 `json:"item_id"`
Role string `json:"role"`
Status string `json:"status"`
Text string `json:"text"`
RawJSON string `json:"raw_json"`
Error string `json:"error"`
Model string `json:"model"`
PromptVersion string `json:"prompt_version"`
Tool string `json:"tool"`
ToolVersion string `json:"tool_version"`
InputHash string `json:"input_hash"`
CompletedAt time.Time `json:"completed_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type ItemMediaRef ¶
type ItemMediaRef struct {
ItemID int64 `json:"item_id"`
MediaAssetID int64 `json:"media_asset_id"`
Ordinal int `json:"ordinal"`
ExpandedURL string `json:"expanded_url"`
RemoteURL string `json:"remote_url"`
MediaType string `json:"media_type"`
DownloadStatus string `json:"download_status"`
DownloadErrors int `json:"download_errors"`
LastDownloadAt time.Time `json:"last_download_attempt_at"`
LocalPath string `json:"local_path"`
ArchiveProvider string `json:"archive_provider"`
ArchiveBucket string `json:"archive_bucket"`
ArchiveKey string `json:"archive_key"`
ArchiveURL string `json:"archive_url"`
ArchiveStatus string `json:"archive_status"`
Width int `json:"width"`
Height int `json:"height"`
LocalPrunedAt time.Time `json:"local_pruned_at"`
}
type ItemSourceRef ¶
type ItemSourceRef struct {
SourceID int64 `json:"source_id"`
SourceKey string `json:"source_key"`
CanonicalURL string `json:"canonical_url"`
SourceType string `json:"source_type"`
Title string `json:"title"`
NotePath string `json:"note_path"`
ExtractStatus string `json:"extract_status"`
SummaryStatus string `json:"summary_status"`
UserTags string `json:"user_tags"`
}
type MediaArchiveResult ¶
type MediaAsset ¶
type MediaAsset struct {
ID int64 `json:"id"`
RemoteURL string `json:"remote_url"`
MediaType string `json:"media_type"`
MIMEType string `json:"mime_type"`
Width int `json:"width"`
Height int `json:"height"`
ByteSize int64 `json:"byte_size"`
ContentHash string `json:"content_hash"`
DownloadStatus string `json:"download_status"`
DownloadError string `json:"download_error"`
DownloadErrors int `json:"download_errors"`
LastDownloadAt time.Time `json:"last_download_attempt_at"`
LocalPath string `json:"local_path"`
ArchiveProvider string `json:"archive_provider"`
ArchiveBucket string `json:"archive_bucket"`
ArchiveKey string `json:"archive_key"`
ArchiveURL string `json:"archive_url"`
ArchiveETag string `json:"archive_etag"`
ArchiveStatus string `json:"archive_status"`
ArchiveError string `json:"archive_error"`
DiscoveredAt time.Time `json:"discovered_at"`
DownloadedAt time.Time `json:"downloaded_at"`
ArchivedAt time.Time `json:"archived_at"`
LocalPrunedAt time.Time `json:"local_pruned_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MediaDownloadResult ¶
type MediaDownloadResult struct {
MIMEType string `json:"mime_type"`
ByteSize int64 `json:"byte_size"`
ContentHash string `json:"content_hash"`
LocalPath string `json:"local_path"`
Status string `json:"status"`
Error string `json:"error"`
AttemptedAt time.Time `json:"attempted_at"`
DownloadedAt time.Time `json:"downloaded_at"`
}
type SearchResult ¶
type SearchResult struct {
SourceKey string `json:"source_key"`
SourceType string `json:"source_type"`
ExternalID string `json:"external_id"`
Title string `json:"title"`
AuthorHandle string `json:"author_handle"`
AuthorName string `json:"author_name"`
CanonicalURL string `json:"canonical_url"`
PrimaryDomain string `json:"primary_domain"`
NotePath string `json:"note_path"`
UserTags string `json:"user_tags"`
Snippet string `json:"snippet"`
}
type SourceBacklink ¶
type SourceBacklink struct {
ItemID int64 `json:"item_id"`
SourceKey string `json:"source_key"`
SourceType string `json:"source_type"`
CanonicalURL string `json:"canonical_url"`
Title string `json:"title"`
NotePath string `json:"note_path"`
AuthorHandle string `json:"author_handle"`
AuthorName string `json:"author_name"`
PublishedAt string `json:"published_at"`
UserTags string `json:"user_tags"`
}
type SourceCandidate ¶
type SourceDocument ¶
type SourceDocument struct {
ID int64 `json:"id"`
SourceKey string `json:"source_key"`
CanonicalURL string `json:"canonical_url"`
NormalizedURL string `json:"normalized_url"`
SourceType string `json:"source_type"`
Domain string `json:"domain"`
Title string `json:"title"`
Description string `json:"description"`
SiteName string `json:"site_name"`
ExtractedText string `json:"extracted_text"`
ExtractJSON string `json:"extract_json"`
ExtractStatus string `json:"extract_status"`
ExtractError string `json:"extract_error"`
ExtractFailureKind string `json:"extract_failure_kind"`
ExtractFailureCount int `json:"extract_failure_count"`
ExtractFirstFailedAt time.Time `json:"extract_first_failed_at"`
ExtractLastFailedAt time.Time `json:"extract_last_failed_at"`
ExtractedAt time.Time `json:"extracted_at"`
ExtractTool string `json:"extract_tool"`
ExtractToolVersion string `json:"extract_tool_version"`
SummaryText string `json:"summary_text"`
SummaryJSON string `json:"summary_json"`
SummaryStatus string `json:"summary_status"`
SummaryError string `json:"summary_error"`
SummaryModel string `json:"summary_model"`
SummaryContentHash string `json:"summary_content_hash"`
SummaryPromptVersion string `json:"summary_prompt_version"`
SummaryTool string `json:"summary_tool"`
SummaryToolVersion string `json:"summary_tool_version"`
SummarizedAt time.Time `json:"summarized_at"`
ContentHash string `json:"content_hash"`
NotePath string `json:"note_path"`
UserTags string `json:"user_tags"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type SourceLinkUpsertResult ¶
type SourceUpsertResult ¶
type SummaryResult ¶
type UpsertResult ¶
type UpsertResult struct {
Status UpsertStatus
ItemID int64
NotePath string
}
type UpsertStatus ¶
type UpsertStatus string
const ( UpsertCreated UpsertStatus = "created" UpsertUpdated UpsertStatus = "updated" UpsertUnchanged UpsertStatus = "unchanged" )