Documentation
¶
Index ¶
- func ApplyToConfig(base *config.Config, runtime *RuntimeSettings) *config.Config
- func RuntimeConfigured(in *RuntimeSettings) bool
- func ToConfigServers(servers []ServerRuntimeSettings) []config.ServerConfig
- func ValidateArrIntegrations(integrations []ArrIntegrationRuntimeSettings) error
- type AggregatorDownloadResult
- type AggregatorModule
- type AggregatorRuntimeSettings
- type AggregatorSourcesRuntimeSettings
- type ArrIntegrationRuntimeSettings
- type ArrNotifier
- type BlobStore
- type Context
- func (ctx *Context) AddCloser(c io.Closer)
- func (ctx *Context) Close()
- func (ctx *Context) CurrentConfig() *config.Config
- func (ctx *Context) RegisterRuntimeModules(modules ...RuntimeModule)
- func (ctx *Context) RuntimeModule(name string) RuntimeModule
- func (ctx *Context) RuntimeModules() []RuntimeModule
- type ControlPlaneCapabilities
- type DownloadRuntimeSettings
- type Downloader
- type DownloaderCommands
- type DownloaderModule
- type DownloaderQueries
- type IndexerAggregator
- type IndexerRuntimeSettings
- type IndexingInspectRuntimeSettings
- type IndexingMatchRuntimeSettings
- type IndexingPreDBRuntimeSettings
- type IndexingReleaseRuntimeSettings
- type IndexingRuntimeSettings
- type IndexingStageRuntimeSettings
- type IndexingTMDBRuntimeSettings
- type JobStore
- type ModuleCapability
- type NNTPManager
- type NZBParser
- type PayloadCacheStore
- type PayloadFetcher
- type Processor
- type QueueAddRequest
- type QueueFileStore
- type QueueManager
- type ReleaseResolver
- type RuntimeCheck
- type RuntimeModule
- type RuntimeSettings
- func ApplyPatch(current *RuntimeSettings, patch *RuntimeSettingsPatch) *RuntimeSettings
- func CloneRuntimeSettings(in *RuntimeSettings) *RuntimeSettings
- func DefaultRuntimeSettings() *RuntimeSettings
- func FromConfig(cfg *config.Config) *RuntimeSettings
- func RedactedCopy(in *RuntimeSettings) *RuntimeSettings
- func WithRuntimeDefaults(in *RuntimeSettings) *RuntimeSettings
- type RuntimeSettingsPatch
- type RuntimeToggle
- type SearchRequest
- type ServerRuntimeSettings
- type SettingsAdmin
- type SettingsCapability
- type SettingsStore
- type UsenetIndexCatalog
- type UsenetIndexStore
- type UsenetIndexerService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyToConfig ¶ added in v0.6.1
func ApplyToConfig(base *config.Config, runtime *RuntimeSettings) *config.Config
ApplyToConfig applies runtime-editable settings on top of bootstrap config.
func RuntimeConfigured ¶ added in v0.7.1
func RuntimeConfigured(in *RuntimeSettings) bool
func ToConfigServers ¶ added in v0.7.1
func ToConfigServers(servers []ServerRuntimeSettings) []config.ServerConfig
func ValidateArrIntegrations ¶ added in v0.6.1
func ValidateArrIntegrations(integrations []ArrIntegrationRuntimeSettings) error
Types ¶
type AggregatorDownloadResult ¶ added in v0.6.1
type AggregatorDownloadResult struct {
Release *domain.Release
Reader io.ReadCloser
RedirectURL string
}
type AggregatorModule ¶ added in v0.6.1
type AggregatorRuntimeSettings ¶ added in v0.7.1
type AggregatorRuntimeSettings struct {
Sources AggregatorSourcesRuntimeSettings `json:"sources,omitempty"`
}
type AggregatorSourcesRuntimeSettings ¶ added in v0.7.1
type AggregatorSourcesRuntimeSettings struct {
LocalBlob RuntimeToggle `json:"local_blob,omitempty"`
UsenetIndexer RuntimeToggle `json:"usenet_indexer,omitempty"`
}
type ArrIntegrationRuntimeSettings ¶ added in v0.6.1
type ArrNotifier ¶ added in v0.6.0
type Context ¶
type Context struct {
BootstrapConfig *config.Config
Config *config.Config
Logger *logger.Logger
// High-level interfaces for services to use
NNTP NNTPManager
Aggregator IndexerAggregator
Resolver ReleaseResolver
UsenetIndexer UsenetIndexerService
Processor Processor
Downloader Downloader
Queue QueueManager
NZBParser NZBParser
JobStore JobStore
QueueFileStore QueueFileStore
BlobStore BlobStore
PayloadFetcher PayloadFetcher
PayloadCacheStore PayloadCacheStore
SettingsStore SettingsStore
PGIndexStore UsenetIndexStore
ArrNotifier ArrNotifier
DownloaderModule DownloaderModule
AggregatorModule AggregatorModule
SettingsAdmin SettingsAdmin
ExtractionEnabled bool
// contains filtered or unexported fields
}
Context hold the core environment and shared resources for GoNZB. It acts as the "Single Source of Truth" for the application state.
func NewContext ¶
NewContext returns the shared application container. Concrete runtime construction lives in internal/runtime/wiring.
func (*Context) AddCloser ¶ added in v0.6.0
allow runtime wiring (from main) to register additional closers.
func (*Context) CurrentConfig ¶ added in v0.6.1
func (*Context) RegisterRuntimeModules ¶ added in v0.6.1
func (ctx *Context) RegisterRuntimeModules(modules ...RuntimeModule)
func (*Context) RuntimeModule ¶ added in v0.6.1
func (ctx *Context) RuntimeModule(name string) RuntimeModule
func (*Context) RuntimeModules ¶ added in v0.6.1
func (ctx *Context) RuntimeModules() []RuntimeModule
type ControlPlaneCapabilities ¶ added in v0.7.1
type ControlPlaneCapabilities struct {
Modules map[string]ModuleCapability `json:"modules"`
Settings SettingsCapability `json:"settings"`
Revision int64 `json:"revision,omitempty"`
}
type DownloadRuntimeSettings ¶ added in v0.6.1
type Downloader ¶ added in v0.5.0
type DownloaderCommands ¶ added in v0.6.1
type DownloaderCommands interface {
EnqueueByReleaseID(ctx context.Context, sourceKind, releaseID, title string) (*domain.QueueItem, error)
EnqueueNZB(ctx context.Context, filename string, file io.Reader) (*domain.QueueItem, error)
EnqueueNZBWithCategory(ctx context.Context, filename, category string, file io.Reader) (*domain.QueueItem, error)
Cancel(id string) bool
CancelMany(ids []string) int
DeleteMany(ctx context.Context, ids []string) (int64, error)
ClearHistory(ctx context.Context) (int64, error)
Pause() bool
Resume() bool
}
type DownloaderModule ¶ added in v0.6.1
type DownloaderModule interface {
Commands() DownloaderCommands
Queries() DownloaderQueries
}
type DownloaderQueries ¶ added in v0.6.1
type DownloaderQueries interface {
ListActive() []*domain.QueueItem
ListHistory(ctx context.Context, status string, limit, offset int) ([]*domain.QueueItem, int, error)
GetActiveItem() *domain.QueueItem
GetItem(ctx context.Context, id string) (*domain.QueueItem, error)
GetItemFiles(ctx context.Context, id string) ([]*domain.DownloadFile, error)
GetItemEvents(ctx context.Context, id string) ([]*domain.QueueItemEvent, error)
IsPaused() bool
}
type IndexerAggregator ¶ added in v0.6.0
type IndexerAggregator interface {
SearchAll(ctx context.Context, query string) ([]*domain.Release, error)
SearchAllWithRequest(ctx context.Context, req SearchRequest) ([]*domain.Release, error)
GetNZB(ctx context.Context, res *domain.Release) (io.ReadCloser, error)
GetResultByID(ctx context.Context, id string) (*domain.Release, error)
}
Manager defines the contract for our NZB search and download engine.
type IndexerRuntimeSettings ¶ added in v0.6.1
type IndexingInspectRuntimeSettings ¶ added in v0.7.0
type IndexingInspectRuntimeSettings struct {
WorkDir string `json:"work_dir,omitempty"`
WorkspaceBackend string `json:"workspace_backend,omitempty"`
MemoryWorkDir string `json:"memory_work_dir,omitempty"`
MaxBytes int64 `json:"max_bytes,omitempty"`
MaxArchiveDepth int `json:"max_archive_depth,omitempty"`
ToolTimeoutSecs int `json:"tool_timeout_seconds,omitempty"`
FFProbePath string `json:"ffprobe_path,omitempty"`
SevenZipPath string `json:"seven_zip_path,omitempty"`
UnrarPath string `json:"unrar_path,omitempty"`
PAR2Path string `json:"par2_path,omitempty"`
}
type IndexingMatchRuntimeSettings ¶ added in v0.7.0
type IndexingPreDBRuntimeSettings ¶ added in v0.7.0
type IndexingPreDBRuntimeSettings struct {
Enabled bool `json:"enabled,omitempty"`
IntervalMinutes float64 `json:"interval_minutes,omitempty"`
BatchSize int `json:"batch_size,omitempty"`
BackoffSeconds int `json:"backoff_seconds,omitempty"`
Provider string `json:"provider,omitempty"`
BaseURL string `json:"base_url,omitempty"`
FeedURL string `json:"feed_url,omitempty"`
DumpURL string `json:"dump_url,omitempty"`
HTTPTimeoutSeconds int `json:"http_timeout_seconds,omitempty"`
BackfillPageSize int `json:"backfill_page_size,omitempty"`
MaxBackfillPages int `json:"max_backfill_pages,omitempty"`
}
type IndexingReleaseRuntimeSettings ¶ added in v0.7.0
type IndexingReleaseRuntimeSettings struct {
Enabled bool `json:"enabled,omitempty"`
IntervalMinutes float64 `json:"interval_minutes,omitempty"`
BatchSize int `json:"batch_size,omitempty"`
BackoffSeconds int `json:"backoff_seconds,omitempty"`
MinConfidence float64 `json:"min_confidence,omitempty"`
MinCompletionPct float64 `json:"min_completion_pct,omitempty"`
RequireExpectedFileCountForContextualObfuscated bool `json:"require_expected_file_count_for_contextual_obfuscated,omitempty"`
}
type IndexingRuntimeSettings ¶ added in v0.6.1
type IndexingRuntimeSettings struct {
Newsgroups []string `json:"newsgroups,omitempty"`
BackfillUntilDateByGroup map[string]string `json:"backfill_until_date_by_group,omitempty"`
ScrapeLatest IndexingStageRuntimeSettings `json:"scrape_latest,omitempty"`
ScrapeBackfill IndexingStageRuntimeSettings `json:"scrape_backfill,omitempty"`
Assemble IndexingStageRuntimeSettings `json:"assemble,omitempty"`
Release IndexingReleaseRuntimeSettings `json:"release,omitempty"`
Match IndexingMatchRuntimeSettings `json:"match,omitempty"`
Inspect IndexingInspectRuntimeSettings `json:"inspect,omitempty"`
InspectDiscovery IndexingStageRuntimeSettings `json:"inspect_discovery,omitempty"`
InspectPAR2 IndexingStageRuntimeSettings `json:"inspect_par2,omitempty"`
InspectNFO IndexingStageRuntimeSettings `json:"inspect_nfo,omitempty"`
InspectArchive IndexingStageRuntimeSettings `json:"inspect_archive,omitempty"`
InspectPassword IndexingStageRuntimeSettings `json:"inspect_password,omitempty"`
InspectMedia IndexingStageRuntimeSettings `json:"inspect_media,omitempty"`
EnrichPreDB IndexingPreDBRuntimeSettings `json:"enrich_predb,omitempty"`
EnrichTMDB IndexingTMDBRuntimeSettings `json:"enrich_tmdb,omitempty"`
}
func IndexingRuntimeFromConfig ¶ added in v0.7.0
func IndexingRuntimeFromConfig(cfg config.IndexingConfig) IndexingRuntimeSettings
type IndexingStageRuntimeSettings ¶ added in v0.7.0
type IndexingTMDBRuntimeSettings ¶ added in v0.7.0
type IndexingTMDBRuntimeSettings struct {
Enabled bool `json:"enabled,omitempty"`
IntervalMinutes float64 `json:"interval_minutes,omitempty"`
BatchSize int `json:"batch_size,omitempty"`
BackoffSeconds int `json:"backoff_seconds,omitempty"`
HTTPTimeoutSeconds int `json:"http_timeout_seconds,omitempty"`
TMDBAPIKey string `json:"tmdb_api_key,omitempty"`
TMDBAccessToken string `json:"tmdb_access_token,omitempty"`
TMDBBaseURL string `json:"tmdb_base_url,omitempty"`
TVDBAPIKey string `json:"tvdb_api_key,omitempty"`
TVDBPIN string `json:"tvdb_pin,omitempty"`
TVDBBaseURL string `json:"tvdb_base_url,omitempty"`
}
type JobStore ¶ added in v0.6.0
type JobStore interface {
// Downloader Queue: SQLite
SaveQueueItem(ctx context.Context, item *domain.QueueItem) error
GetQueueItem(ctx context.Context, id string) (*domain.QueueItem, error)
GetQueueItems(ctx context.Context) ([]*domain.QueueItem, error)
GetActiveQueueItems(ctx context.Context) ([]*domain.QueueItem, error)
DeleteQueueItems(ctx context.Context, ids []string) (int64, error)
ClearQueueHistory(ctx context.Context, statuses []domain.JobStatus) (int64, error)
SaveQueueEvent(ctx context.Context, ev *domain.QueueItemEvent) error
GetQueueEvents(ctx context.Context, queueID string) ([]*domain.QueueItemEvent, error)
ResetStuckQueueItems(ctx context.Context, newStatus domain.JobStatus, oldStatuses ...domain.JobStatus) error
// store liveness + schema handshake.
Ping(ctx context.Context) error
SchemaVersion(ctx context.Context) (int, error)
ExpectedSchemaVersion() int
ValidateSchema(ctx context.Context) error
}
JobStore defines downloader queue/event/history persistence.
type ModuleCapability ¶ added in v0.7.1
type NNTPManager ¶
type PayloadCacheStore ¶ added in v0.6.0
type PayloadFetcher ¶ added in v0.6.0
type PayloadFetcher interface {
GetNZB(ctx context.Context, sourceKind string, res *domain.Release) (io.ReadCloser, error)
}
payload fetch now routes by persisted source kind.
type Processor ¶
type Processor interface {
// processor now needs the queue item so it can use a per-job work dir
Prepare(ctx context.Context, item *domain.QueueItem, nzbModel *nzb.Model, nzbFilename string) (*domain.PreparationResult, error)
Finalize(ctx context.Context, tasks []*domain.DownloadFile) error
PostProcess(ctx context.Context, item *domain.QueueItem, tasks []*domain.DownloadFile) error
}
type QueueAddRequest ¶ added in v0.6.0
type QueueAddRequest struct {
SourceKind string
SourceReleaseID string
Release *domain.Release
Title string
}
explicit queue enqueue contract so downloader does not infer source provenance.
type QueueFileStore ¶ added in v0.6.0
type QueueFileStore interface {
SaveQueueItemFiles(ctx context.Context, queueItemID string, files []*domain.DownloadFile) error
GetQueueItemFiles(ctx context.Context, queueItemID string) ([]*domain.DownloadFile, error)
}
downloader-owned queue item file metadata
type QueueManager ¶ added in v0.5.0
type QueueManager interface {
Start(ctx context.Context)
Add(ctx context.Context, req QueueAddRequest) (*domain.QueueItem, error)
GetActiveItem() *domain.QueueItem
GetItem(ctx context.Context, id string) (*domain.QueueItem, bool)
GetAllItems() []*domain.QueueItem
Cancel(id string) bool
Delete(id string) bool
Stop()
Pause() bool
Resume() bool
IsPaused() bool
HydrateItem(ctx context.Context, item *domain.QueueItem) error
UpdateStatus(ctx context.Context, item *domain.QueueItem, status domain.JobStatus)
ReloadRuntime(appCtx *Context) // refresh future-job dependencies after settings reload
}
type ReleaseResolver ¶ added in v0.6.0
type ReleaseResolver interface {
GetRelease(ctx context.Context, sourceKind, sourceReleaseID string) (*domain.Release, error)
GetNZB(ctx context.Context, sourceKind string, res *domain.Release) (io.ReadCloser, error)
}
resolver routes by source kind instead of assuming aggregator-only resolution.
type RuntimeCheck ¶ added in v0.6.1
type RuntimeModule ¶ added in v0.6.1
type RuntimeSettings ¶ added in v0.6.1
type RuntimeSettings struct {
Servers []ServerRuntimeSettings `json:"servers,omitempty"`
DownloaderServers []ServerRuntimeSettings `json:"downloader_servers,omitempty"`
IndexerServers []ServerRuntimeSettings `json:"indexer_servers,omitempty"`
Indexers []IndexerRuntimeSettings `json:"indexers,omitempty"`
Aggregator *AggregatorRuntimeSettings `json:"aggregator,omitempty"`
Download *DownloadRuntimeSettings `json:"download,omitempty"`
Indexing *IndexingRuntimeSettings `json:"indexing,omitempty"`
ArrIntegrations []ArrIntegrationRuntimeSettings `json:"arr_integrations,omitempty"`
Revision int64 `json:"revision,omitempty"`
}
func ApplyPatch ¶ added in v0.6.1
func ApplyPatch(current *RuntimeSettings, patch *RuntimeSettingsPatch) *RuntimeSettings
ApplyPatch applies an incoming patch to the current runtime settings.
func CloneRuntimeSettings ¶ added in v0.6.1
func CloneRuntimeSettings(in *RuntimeSettings) *RuntimeSettings
CloneRuntimeSettings returns a deep copy of runtime settings.
func DefaultRuntimeSettings ¶ added in v0.7.1
func DefaultRuntimeSettings() *RuntimeSettings
func FromConfig ¶ added in v0.6.1
func FromConfig(cfg *config.Config) *RuntimeSettings
FromConfig derives editable runtime state from current effective config.
func RedactedCopy ¶ added in v0.6.1
func RedactedCopy(in *RuntimeSettings) *RuntimeSettings
RedactedCopy removes secrets before returning settings externally.
func WithRuntimeDefaults ¶ added in v0.7.1
func WithRuntimeDefaults(in *RuntimeSettings) *RuntimeSettings
type RuntimeSettingsPatch ¶ added in v0.6.1
type RuntimeSettingsPatch struct {
Servers *[]ServerRuntimeSettings `json:"servers,omitempty"`
DownloaderServers *[]ServerRuntimeSettings `json:"downloader_servers,omitempty"`
IndexerServers *[]ServerRuntimeSettings `json:"indexer_servers,omitempty"`
Indexers *[]IndexerRuntimeSettings `json:"indexers,omitempty"`
Aggregator *AggregatorRuntimeSettings `json:"aggregator,omitempty"`
Download *DownloadRuntimeSettings `json:"download,omitempty"`
Indexing *IndexingRuntimeSettings `json:"indexing,omitempty"`
ArrIntegrations *[]ArrIntegrationRuntimeSettings `json:"arr_integrations,omitempty"`
}
type RuntimeToggle ¶ added in v0.7.1
type RuntimeToggle struct {
Enabled bool `json:"enabled"`
}
type SearchRequest ¶ added in v0.6.1
type ServerRuntimeSettings ¶ added in v0.6.1
type ServerRuntimeSettings struct {
ID string `json:"id"`
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
TLS bool `json:"tls"`
MaxConnection int `json:"max_connections"`
Priority int `json:"priority"`
DialTimeoutSeconds int `json:"dial_timeout_seconds"`
TCPKeepAliveSeconds int `json:"tcp_keepalive_seconds"`
PoolIdleTimeoutSeconds int `json:"pool_idle_timeout_seconds"`
PoolMaxAgeSeconds int `json:"pool_max_age_seconds"`
EnablePoolLogging bool `json:"enable_pool_logging"`
}
func DownloaderNNTPServers ¶ added in v0.7.1
func DownloaderNNTPServers(in *RuntimeSettings) []ServerRuntimeSettings
func IndexerNNTPServers ¶ added in v0.7.1
func IndexerNNTPServers(in *RuntimeSettings) []ServerRuntimeSettings
func RuntimeServersForCompatibility ¶ added in v0.7.1
func RuntimeServersForCompatibility(in *RuntimeSettings) []ServerRuntimeSettings
type SettingsAdmin ¶ added in v0.6.1
type SettingsAdmin interface {
Get(ctx context.Context) (*RuntimeSettings, error)
Capabilities(ctx context.Context) (*ControlPlaneCapabilities, error)
Update(ctx context.Context, patch *RuntimeSettingsPatch) (*RuntimeSettings, error)
}
type SettingsCapability ¶ added in v0.7.1
type SettingsCapability struct {
RuntimeConfigured bool `json:"runtime_configured"`
}
type SettingsStore ¶ added in v0.6.0
type SettingsStore interface {
LoadEffectiveSettings(ctx context.Context, base *config.Config) (*config.Config, error)
GetRuntimeSettings(ctx context.Context, base ...*config.Config) (*RuntimeSettings, error)
UpdateSettings(ctx context.Context, next *RuntimeSettings) error
WatchSettingsChanges(ctx context.Context) (<-chan struct{}, error)
// store liveness + schema handshake.
Ping(ctx context.Context) error
SchemaVersion(ctx context.Context) (int, error)
ExpectedSchemaVersion() int
ValidateSchema(ctx context.Context) error
}
Runtime settings
type UsenetIndexCatalog ¶ added in v0.6.0
type UsenetIndexCatalog interface {
GetCatalogReleaseByID(ctx context.Context, releaseID string) (*domain.Release, error)
}
minimal PG catalog boundary for Milestone 7 resolver routing.
type UsenetIndexStore ¶ added in v0.6.1
type UsenetIndexStore interface {
UsenetIndexCatalog
Ping(ctx context.Context) error
ValidateSchema(ctx context.Context) error
ListCatalogReleaseFiles(ctx context.Context, releaseID string) ([]pgindex.CatalogReleaseFile, error)
ListCatalogReleaseFileArticles(ctx context.Context, releaseFileID int64) ([]pgindex.CatalogArticleRef, error)
ListCatalogReleaseNewsgroups(ctx context.Context, releaseID string) ([]string, error)
UpsertNZBCache(ctx context.Context, releaseID, generationStatus, hashSHA256, lastError string) error
ClaimIndexerStage(ctx context.Context, req pgindex.IndexerStageClaimRequest) (*pgindex.IndexerStageClaimResult, error)
HeartbeatIndexerStageRun(ctx context.Context, runID int64, owner string, leaseDuration time.Duration) error
CompleteIndexerStageRun(ctx context.Context, req pgindex.IndexerStageFinishRequest) error
FailIndexerStageRun(ctx context.Context, req pgindex.IndexerStageFinishRequest) error
PauseIndexerStage(ctx context.Context, stageName string) error
ResumeIndexerStage(ctx context.Context, stageName string) error
RepairIndexerStageRuntime(ctx context.Context) (*pgindex.IndexerStageRepairResult, error)
ListIndexerStageStates(ctx context.Context) ([]pgindex.IndexerStageState, error)
ListIndexerStageRuns(ctx context.Context, stageName string, limit int) ([]pgindex.IndexerStageRun, error)
ListIndexerStageRunsFiltered(ctx context.Context, params pgindex.IndexerStageRunListParams) ([]pgindex.IndexerStageRun, error)
GetIndexerStageRun(ctx context.Context, runID int64) (*pgindex.IndexerStageRun, error)
GetIndexerOverview(ctx context.Context) (*pgindex.IndexerOverview, error)
GetIndexerDashboardStats(ctx context.Context) (*pgindex.IndexerDashboardStats, error)
RefreshIndexerDashboardStats(ctx context.Context) (*pgindex.IndexerDashboardStats, error)
GetIndexerBackfillProgress(ctx context.Context) (*pgindex.IndexerBackfillProgress, error)
GetIndexerStageThroughput(ctx context.Context) (*pgindex.IndexerStageThroughput, error)
ListIndexerReleases(ctx context.Context, params pgindex.AdminIndexerReleaseListParams) ([]pgindex.IndexerReleaseSummary, int, error)
GetIndexerReleaseDetail(ctx context.Context, releaseID string) (*pgindex.IndexerReleaseDetail, error)
ListPublicIndexerReleases(ctx context.Context, params pgindex.PublicIndexerReleaseListParams) ([]pgindex.PublicIndexerReleaseSummary, int, error)
GetPublicIndexerReleaseDetail(ctx context.Context, releaseID string) (*pgindex.PublicIndexerReleaseDetail, error)
UpsertReleaseOverride(ctx context.Context, in pgindex.ReleaseOverrideRecord) error
GetReleaseOverride(ctx context.Context, releaseID string) (*pgindex.ReleaseOverrideRecord, error)
ResetReleaseInspectionState(ctx context.Context, releaseID string) error
ResetReleaseEnrichmentState(ctx context.Context, releaseID string) error
GetIndexerBinaryDetail(ctx context.Context, binaryID int64) (*pgindex.IndexerBinaryDetail, error)
GetIndexerFileDetail(ctx context.Context, fileID int64) (*pgindex.IndexerFileDetail, error)
EnsureProvider(ctx context.Context, providerKey, displayName string) (int64, error)
EnsureNewsgroup(ctx context.Context, groupName string) (int64, error)
StartScrapeRun(ctx context.Context, providerID int64) (int64, error)
FinishScrapeRun(ctx context.Context, runID int64, status, errorText string) error
GetLatestCheckpoint(ctx context.Context, providerID, newsgroupID int64) (int64, error)
UpsertLatestCheckpoint(ctx context.Context, providerID, newsgroupID, lastArticleNumber int64) error
GetBackfillCheckpoint(ctx context.Context, providerID, newsgroupID int64) (int64, error)
UpsertBackfillCheckpoint(ctx context.Context, providerID, newsgroupID, backfillArticleNumber int64) error
GetBackfillCheckpointState(ctx context.Context, providerID, newsgroupID int64) (*pgindex.BackfillCheckpointState, error)
HasBackfillCutoffReachedForGroup(ctx context.Context, newsgroupID int64, untilDate time.Time) (bool, error)
SetBackfillCheckpointState(ctx context.Context, providerID, newsgroupID int64, untilDate *time.Time, cutoffReached bool, stoppedReason string) error
InsertArticleHeaders(ctx context.Context, providerID, newsgroupID int64, headers []pgindex.ArticleHeader) (int64, error)
ListUnassembledArticleHeaders(ctx context.Context, limit int) ([]pgindex.AssemblyCandidate, error)
ClaimUnassembledArticleHeaders(ctx context.Context, req pgindex.AssemblyClaimRequest) ([]pgindex.AssemblyCandidate, error)
RecordYEncRecoveryNotFound(ctx context.Context, articleHeaderID int64) error
EnsurePoster(ctx context.Context, posterName string) (int64, error)
UpsertBinary(ctx context.Context, in pgindex.BinaryRecord) (int64, error)
UpsertBinaryPart(ctx context.Context, in pgindex.BinaryPartRecord) error
UpsertBinaryParts(ctx context.Context, records []pgindex.BinaryPartRecord) error
RefreshBinaryStats(ctx context.Context, binaryID int64) error
RefreshBinaryStatsBatch(ctx context.Context, binaryIDs []int64) error
ListReleaseCandidates(ctx context.Context, limit int) ([]pgindex.ReleaseCandidate, error)
ListExistingReleaseCandidates(ctx context.Context, limit, offset int) ([]pgindex.ReleaseCandidate, error)
ListBinariesForReleaseCandidate(ctx context.Context, providerID, newsgroupID int64, keyKind, releaseKey string) ([]pgindex.BinarySummary, error)
ListBinaryPartArticles(ctx context.Context, binaryID int64) ([]pgindex.ReleaseFileArticleRecord, error)
ListBinaryPartArticlesBatch(ctx context.Context, binaryIDs []int64) (map[int64][]pgindex.ReleaseFileArticleRecord, error)
ListReleaseTitleCandidates(ctx context.Context, binaryIDs []int64) ([]pgindex.ReleaseTitleCandidate, error)
UpsertRelease(ctx context.Context, in pgindex.ReleaseRecord) (string, error)
DeleteStaleReleasesForSourceKey(ctx context.Context, providerID int64, releaseKey string, keepGroupNames []string) error
ReplaceReleaseFiles(ctx context.Context, releaseID string, files []pgindex.ReleaseFileRecord) error
ReplaceReleaseNewsgroups(ctx context.Context, releaseID string, newsgroupIDs []int64) error
AckReleaseCandidate(ctx context.Context, providerID, newsgroupID int64, keyKind, familyKey string) error
AckReleaseCandidates(ctx context.Context, candidates []pgindex.ReleaseCandidateAck) error
RunIndexerMaintenance(ctx context.Context) (*pgindex.IndexerMaintenanceResult, error)
ListBinaryInspectionCandidates(ctx context.Context, stageName string, limit int) ([]pgindex.BinaryInspectionCandidate, error)
ClaimBinaryInspectionCandidates(ctx context.Context, req pgindex.BinaryInspectionClaimRequest) ([]pgindex.BinaryInspectionCandidate, error)
StartBinaryInspection(ctx context.Context, stageName string, binaryID int64, releaseID string, sourceUpdatedAt *time.Time) error
CompleteBinaryInspection(ctx context.Context, in pgindex.BinaryInspectionRecord) error
FailBinaryInspection(ctx context.Context, in pgindex.BinaryInspectionRecord) error
ReplaceBinaryInspectionArtifacts(ctx context.Context, stageName string, binaryID int64, rows []pgindex.BinaryInspectionArtifactRecord) error
ReplaceBinaryArchiveEntries(ctx context.Context, binaryID int64, rows []pgindex.BinaryArchiveEntryRecord) error
ReplaceBinaryMediaStreams(ctx context.Context, binaryID int64, rows []pgindex.BinaryMediaStreamRecord) error
ReplaceBinaryTextEvidence(ctx context.Context, stageName string, binaryID int64, rows []pgindex.BinaryTextEvidenceRecord) error
ReplaceBinaryPAR2Sets(ctx context.Context, binaryID int64, rows []pgindex.BinaryPAR2SetRecord) error
ApplyBinaryRecovery(ctx context.Context, in pgindex.BinaryRecoveryRecord) error
UpsertReleasePasswordCandidate(ctx context.Context, in pgindex.ReleasePasswordCandidateRecord) (int64, error)
ListPasswordVerificationCandidates(ctx context.Context, limit int) ([]pgindex.PasswordVerificationCandidate, error)
UpdateReleasePasswordCandidateStatus(ctx context.Context, candidateID int64, status string, verifiedAt *time.Time, lastError string) error
ApplyReleaseInspectionUpdate(ctx context.Context, in pgindex.ReleaseInspectionUpdate) error
ListReleaseEnrichmentCandidates(ctx context.Context, stageName string, limit int) ([]pgindex.ReleaseEnrichmentCandidate, error)
UpsertPredbEntries(ctx context.Context, rows []pgindex.PredbEntryRecord) error
GetPredbBackfillWindow(ctx context.Context) (*pgindex.PredbBackfillWindow, error)
GetPredbEntryWindow(ctx context.Context) (*pgindex.PredbBackfillWindow, error)
GetPredbBackfillCheckpoint(ctx context.Context, provider string) (*pgindex.PredbBackfillCheckpoint, error)
UpsertPredbBackfillCheckpoint(ctx context.Context, in pgindex.PredbBackfillCheckpoint) error
ListPredbEntriesForWindow(ctx context.Context, from, to *time.Time, categoryHint string, limit int) ([]pgindex.PredbEntrySummary, error)
ReplaceReleasePredbMatches(ctx context.Context, releaseID string, rows []pgindex.ReleasePredbMatchRecord) error
ReplaceReleaseTMDBMatches(ctx context.Context, releaseID string, rows []pgindex.ReleaseTMDBMatchRecord) error
ReplaceReleaseTVDBMatches(ctx context.Context, releaseID string, rows []pgindex.ReleaseTVDBMatchRecord) error
ApplyReleasePredbUpdate(ctx context.Context, in pgindex.ReleasePredbUpdate) error
ApplyReleaseEnrichmentUpdate(ctx context.Context, in pgindex.ReleaseEnrichmentUpdate) error
}
current PG-backed store surface used by resolver, indexing runtime, health checks, and smoke tests. This keeps Context from depending on the concrete *pgindex.Store type directly.
type UsenetIndexerService ¶ added in v0.6.0
type UsenetIndexerService interface {
ScrapeOnce(ctx context.Context) error
ScrapeLatestOnce(ctx context.Context) error
ScrapeBackfillOnce(ctx context.Context) error
AssembleOnce(ctx context.Context) error
ReleaseOnce(ctx context.Context) error
ReformReleasesOnce(ctx context.Context) error
InspectOnce(ctx context.Context) error
InspectDiscoveryOnce(ctx context.Context) error
InspectPAR2Once(ctx context.Context) error
InspectNFOOnce(ctx context.Context) error
InspectArchiveOnce(ctx context.Context) error
InspectPasswordOnce(ctx context.Context) error
InspectMediaOnce(ctx context.Context) error
EnrichPredbOnce(ctx context.Context) error
EnrichPredbSceneNameRecoveryOnce(ctx context.Context) error
EnrichPredbMetadataFallbackOnce(ctx context.Context) error
EnrichPredbSyncFeedOnce(ctx context.Context) error
EnrichPredbSyncBackfillOnce(ctx context.Context) error
EnrichTMDBOnce(ctx context.Context) error
RunStageOnce(ctx context.Context, stageName string) error
RunPipelineOnce(ctx context.Context) error
Start(ctx context.Context, interval time.Duration) error
}