Documentation
¶
Index ¶
- type APIQueueUploadRequest
- type APIQueueUploadResult
- type App
- func (a *App) AddFilesToQueue() error
- func (a *App) ApplyPendingConfig() error
- func (a *App) CancelJob(id string) error
- func (a *App) CancelUpload() error
- func (a *App) ClearQueue() error
- func (a *App) DebugQueueItem(id string) (map[string]any, error)
- func (a *App) DiscardPendingConfig() error
- func (a *App) DownloadLogFile() error
- func (a *App) DownloadNZB(id string) error
- func (a *App) EnqueueAPIUpload(ctx context.Context, req APIQueueUploadRequest) (*APIQueueUploadResult, error)
- func (a *App) GetAPIKey() (string, error)
- func (a *App) GetAppStatus() AppStatus
- func (a *App) GetAppliedConfig() (*config.ConfigData, error)
- func (a *App) GetArrInstances() ([]config.ArrInstance, error)
- func (a *App) GetAutoPauseReason() string
- func (a *App) GetConfig() (*config.ConfigData, error)
- func (a *App) GetConfigPath() string
- func (a *App) GetLoggingStatus() map[string]any
- func (a *App) GetLogs() (string, error)
- func (a *App) GetLogsPaginated(limit, offset int) (string, error)
- func (a *App) GetMigrationStatus() (map[string]any, error)
- func (a *App) GetNZB(id string) (content string, fileName string, err error)
- func (a *App) GetNntpPoolMetrics() (NntpPoolMetrics, error)
- func (a *App) GetOutputDirectory() string
- func (a *App) GetPendingConfigStatus() map[string]any
- func (a *App) GetProcessorStatus() ProcessorStatus
- func (a *App) GetQueueItems(params PaginationParams) (*PaginatedQueueResult, error)
- func (a *App) GetQueueStats() (QueueStats, error)
- func (a *App) GetRunningJobs() ([]processor.RunningJobItem, error)
- func (a *App) GetRunningJobsDetails() ([]processor.RunningJobDetails, error)
- func (a *App) GetTransferRuntimeMetrics() TransferRuntimeMetrics
- func (a *App) GetWatchDirectory() string
- func (a *App) GetWatcherStatus() []watcher.WatcherStatusInfo
- func (a *App) HandleDroppedFiles(filePaths []string) error
- func (a *App) HasPendingConfigChanges() bool
- func (a *App) IsAPIEnabled() bool
- func (a *App) IsLegacyDatabase() (bool, error)
- func (a *App) IsProcessingAutoPaused() bool
- func (a *App) IsProcessingPaused() bool
- func (a *App) IsUploading() bool
- func (a *App) MigrateTo(version int64) error
- func (a *App) NavigateToDashboard()
- func (a *App) NavigateToSettings()
- func (a *App) PauseProcessing() error
- func (a *App) RecreateDatabase() error
- func (a *App) RegenerateAPIKey() (string, error)
- func (a *App) RemoveArrInstance(ctx context.Context, instanceID string) error
- func (a *App) RemoveFromQueue(id string) error
- func (a *App) ResetDatabase() error
- func (a *App) ResumeProcessing() error
- func (a *App) RetryJob(id string) error
- func (a *App) RetryScript(id string) error
- func (a *App) RollbackMigration() error
- func (a *App) RunMigrations() error
- func (a *App) SaveConfig(configData *config.ConfigData) error
- func (a *App) SelectConfigFile() (string, error)
- func (a *App) SelectFolder() (string, error)
- func (a *App) SelectFolders() ([]string, error)
- func (a *App) SelectOutputDirectory() (string, error)
- func (a *App) SelectTempDirectory() (string, error)
- func (a *App) SelectWatchDirectory() (string, error)
- func (a *App) SetQueueItemPriority(id string, priority int) error
- func (a *App) SetWebEventEmitter(emitter func(eventType string, data any))
- func (a *App) SetWebMode(isWeb bool)
- func (a *App) SetupArrWebhook(ctx context.Context, instance config.ArrInstance, webhookURL string) (config.ArrInstance, error)
- func (a *App) SetupWizardComplete(wizardData SetupWizardData) error
- func (a *App) Shutdown()
- func (a *App) Startup(ctx context.Context)
- func (a *App) TestArrConnection(ctx context.Context, instance config.ArrInstance) error
- func (a *App) TestProviderConnectivity(serverData ServerData) ValidationResult
- func (a *App) TriggerScan()
- func (a *App) UploadFiles() error
- func (a *App) UploadFolder(folderPath string) error
- func (a *App) UploadFolders(folderPaths []string) error
- func (a *App) ValidateNNTPServer(serverData ServerData) ValidationResult
- type AppPaths
- type AppStatus
- type NntpPoolMetrics
- type NntpProviderMetrics
- type PaginatedQueueResult
- type PaginationParams
- type ProcessingPauseState
- type ProcessorStatus
- type QueueItem
- type QueueStats
- type ServerData
- type SetupWizardData
- type TransferRuntimeMetrics
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIQueueUploadRequest ¶ added in v0.0.30
type APIQueueUploadRequest struct {
File string `json:"file"`
RelativePath string `json:"relative_path"`
Priority int `json:"priority,omitempty"`
DeleteAfterUpload bool `json:"delete_after_upload,omitempty"`
}
APIQueueUploadRequest is the JSON body accepted by the gated upload endpoint.
type APIQueueUploadResult ¶ added in v0.0.30
APIQueueUploadResult describes the side-effect of a successful enqueue call.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App struct for the Wails application
func (*App) AddFilesToQueue ¶
AddFilesToQueue adds multiple files to the queue for processing
func (*App) ApplyPendingConfig ¶ added in v0.0.13
ApplyPendingConfig manually applies pending configuration changes
func (*App) CancelUpload ¶
CancelUpload is no longer used - individual jobs are cancelled via CancelJob This function is kept for backward compatibility but does nothing
func (*App) ClearQueue ¶
ClearQueue removes all completed and failed items from the queue via queue
func (*App) DebugQueueItem ¶
DebugQueueItem returns debug information about a queue item
func (*App) DiscardPendingConfig ¶ added in v0.0.13
DiscardPendingConfig discards pending configuration changes
func (*App) DownloadLogFile ¶ added in v0.0.29
DownloadLogFile opens a save dialog and downloads the log file
func (*App) DownloadNZB ¶
DownloadNZB downloads the NZB file for a completed item
func (*App) EnqueueAPIUpload ¶ added in v0.0.30
func (a *App) EnqueueAPIUpload(ctx context.Context, req APIQueueUploadRequest) (*APIQueueUploadResult, error)
EnqueueAPIUpload validates an API upload request and pushes it onto the queue with the appropriate per-job options. Used by the HTTP handler in cmd/web.
func (*App) GetAPIKey ¶ added in v0.0.30
GetAPIKey returns the persisted HTTP API key, generating one on first call when none exists. Exposed to the desktop UI via Wails.
func (*App) GetAppStatus ¶
GetAppStatus returns the current application status
func (*App) GetAppliedConfig ¶ added in v0.0.13
func (a *App) GetAppliedConfig() (*config.ConfigData, error)
GetAppliedConfig returns the currently applied configuration (ignoring pending)
func (*App) GetArrInstances ¶ added in v0.0.30
func (a *App) GetArrInstances() ([]config.ArrInstance, error)
GetArrInstances returns all configured arr instances.
func (*App) GetAutoPauseReason ¶ added in v0.0.20
GetAutoPauseReason returns the reason for automatic pause, if any
func (*App) GetConfig ¶
func (a *App) GetConfig() (*config.ConfigData, error)
GetConfig returns the current configuration (pending config if available, otherwise applied config)
func (*App) GetConfigPath ¶
GetConfigPath returns the path to the configuration file
func (*App) GetLoggingStatus ¶ added in v0.0.10
GetLoggingStatus returns information about logging configuration
func (*App) GetLogsPaginated ¶
GetLogsPaginated returns paginated log content limit: number of lines to return (0 = use original 1MB limit) offset: number of lines to skip from the end (0 = start from most recent)
func (*App) GetMigrationStatus ¶ added in v0.0.22
GetMigrationStatus returns the current migration status
func (*App) GetNZB ¶ added in v0.0.22
GetNZBContent returns the content of an NZB file for a completed item
func (*App) GetNntpPoolMetrics ¶ added in v0.0.16
func (a *App) GetNntpPoolMetrics() (NntpPoolMetrics, error)
GetNntpPoolMetrics returns NNTP connection pool metrics from the singleton pool manager
func (*App) GetOutputDirectory ¶
GetOutputDirectory returns the current output directory
func (*App) GetPendingConfigStatus ¶ added in v0.0.13
GetPendingConfigStatus returns the status of pending config changes
func (*App) GetProcessorStatus ¶
func (a *App) GetProcessorStatus() ProcessorStatus
GetProcessorStatus returns processor status information
func (*App) GetQueueItems ¶
func (a *App) GetQueueItems(params PaginationParams) (*PaginatedQueueResult, error)
GetQueueItems returns the current queue items from the queue
func (*App) GetQueueStats ¶
func (a *App) GetQueueStats() (QueueStats, error)
GetQueueStats returns statistics about the queue via queue
func (*App) GetRunningJobs ¶
func (a *App) GetRunningJobs() ([]processor.RunningJobItem, error)
GetRunningJobs returns currently running jobs from the processor
func (*App) GetRunningJobsDetails ¶ added in v0.0.13
func (a *App) GetRunningJobsDetails() ([]processor.RunningJobDetails, error)
GetRunningJobsDetails returns detailed information about currently running jobs
func (*App) GetTransferRuntimeMetrics ¶ added in v0.0.30
func (a *App) GetTransferRuntimeMetrics() TransferRuntimeMetrics
GetTransferRuntimeMetrics returns process-wide upload/PAR2 scheduler metrics (active/queued upload workers, reserved/configured buffer bytes, active/queued PAR2 jobs) for the diagnostics dashboard. Zero value when no processor.
func (*App) GetWatchDirectory ¶
GetWatchDirectory returns the current watch directory
func (*App) GetWatcherStatus ¶ added in v0.0.24
func (a *App) GetWatcherStatus() []watcher.WatcherStatusInfo
GetWatcherStatus returns the current status of all watchers
func (*App) HandleDroppedFiles ¶
HandleDroppedFiles processes files that are dropped onto the application window
func (*App) HasPendingConfigChanges ¶ added in v0.0.13
HasPendingConfigChanges returns whether there are pending config changes
func (*App) IsAPIEnabled ¶ added in v0.0.30
IsAPIEnabled reports whether the gated HTTP API endpoint is currently enabled in config.
func (*App) IsLegacyDatabase ¶ added in v0.0.22
IsLegacyDatabase checks if the database is a legacy (non-goose) database
func (*App) IsProcessingAutoPaused ¶ added in v0.0.20
IsProcessingAutoPaused returns whether the processor was automatically paused due to provider unavailability
func (*App) IsProcessingPaused ¶ added in v0.0.14
IsProcessingPaused returns whether the processor is currently paused
func (*App) IsUploading ¶
IsUploading returns whether any uploads are in progress (via processor)
func (*App) NavigateToDashboard ¶
func (a *App) NavigateToDashboard()
NavigateToDashboard emits an event to navigate to the dashboard page
func (*App) NavigateToSettings ¶
func (a *App) NavigateToSettings()
NavigateToSettings emits an event to navigate to the settings page
func (*App) PauseProcessing ¶ added in v0.0.14
PauseProcessing pauses the processor to prevent new jobs from starting
func (*App) RecreateDatabase ¶ added in v0.0.22
RecreateDatabase drops all tables and recreates them using migrations
func (*App) RegenerateAPIKey ¶ added in v0.0.30
RegenerateAPIKey replaces the stored key with a fresh one and returns the new value. Exposed to the desktop UI via Wails.
func (*App) RemoveArrInstance ¶ added in v0.0.30
RemoveArrInstance removes the arr webhook from the app and deletes the instance from config. If the webhook cannot be removed from arr (e.g. the arr instance is unreachable), the instance is still removed from config.
func (*App) RemoveFromQueue ¶
RemoveFromQueue removes an item from the queue via queue
func (*App) ResetDatabase ¶ added in v0.0.22
ResetDatabase drops all tables and re-runs all migrations
func (*App) ResumeProcessing ¶ added in v0.0.14
ResumeProcessing resumes the processor to allow new jobs to start
func (*App) RetryScript ¶ added in v0.0.29
RetryScript manually retries a failed post-upload script execution
func (*App) RollbackMigration ¶ added in v0.0.22
RollbackMigration rolls back the last applied migration
func (*App) RunMigrations ¶ added in v0.0.22
RunMigrations runs all pending migrations
func (*App) SaveConfig ¶
func (a *App) SaveConfig(configData *config.ConfigData) error
SaveConfig saves the configuration
func (*App) SelectConfigFile ¶
SelectConfigFile allows user to select a config file
func (*App) SelectFolder ¶ added in v0.0.29
SelectFolder opens a native folder picker dialog and returns the selected folder path Returns empty string if no folder was selected
func (*App) SelectFolders ¶ added in v0.0.30
SelectFolders opens a native multi-select dialog and returns paths of all selected folders. Returns nil slice (not an error) when the user cancels.
func (*App) SelectOutputDirectory ¶
SelectOutputDirectory allows user to select an output directory
func (*App) SelectTempDirectory ¶
SelectTempDirectory allows user to select a temporary directory for PAR2 files
func (*App) SelectWatchDirectory ¶
SelectWatchDirectory allows user to select a watch directory
func (*App) SetQueueItemPriority ¶
SetQueueItemPriority updates the priority of a pending queue item by id and reorders the queue
func (*App) SetWebEventEmitter ¶
SetWebEventEmitter sets the event emitter function for web mode
func (*App) SetWebMode ¶
SetWebMode sets the application to web mode
func (*App) SetupArrWebhook ¶ added in v0.0.30
func (a *App) SetupArrWebhook(ctx context.Context, instance config.ArrInstance, webhookURL string) (config.ArrInstance, error)
SetupArrWebhook registers a Postie import webhook with the given arr instance, persists the instance (with the returned WebhookID) to config, and saves config. webhookURL must be the full URL Postie is reachable at, including the ?apiKey query param so arr can authenticate the call.
func (*App) SetupWizardComplete ¶ added in v0.0.7
func (a *App) SetupWizardComplete(wizardData SetupWizardData) error
SetupWizardComplete saves the configuration from the setup wizard
func (*App) Shutdown ¶ added in v0.0.16
func (a *App) Shutdown()
Shutdown gracefully shuts down the application and closes all resources
func (*App) Startup ¶
Startup is called when the app starts. The context is saved so we can call the runtime methods
func (*App) TestArrConnection ¶ added in v0.0.30
TestArrConnection verifies the given arr instance is reachable and the API key is valid.
func (*App) TestProviderConnectivity ¶ added in v0.0.20
func (a *App) TestProviderConnectivity(serverData ServerData) ValidationResult
TestProviderConnectivity tests an individual provider's connectivity using the nntppool v4 method
func (*App) TriggerScan ¶ added in v0.0.29
func (a *App) TriggerScan()
TriggerScan triggers an immediate directory scan on all active watchers
func (*App) UploadFiles ¶
UploadFiles uploads the selected files using the queue system
func (*App) UploadFolder ¶ added in v0.0.29
UploadFolder uploads all files from a folder as a single NZB The folder structure will be preserved in the article subjects
func (*App) UploadFolders ¶ added in v0.0.30
UploadFolders queues multiple folders for upload as separate NZBs.
func (*App) ValidateNNTPServer ¶ added in v0.0.7
func (a *App) ValidateNNTPServer(serverData ServerData) ValidationResult
ValidateNNTPServer validates an NNTP server configuration using TestProviderConnectivity
type AppPaths ¶
AppPaths holds the various paths needed by the application
func GetAppPaths ¶
GetAppPaths returns the appropriate paths for the current operating system
type AppStatus ¶ added in v0.0.8
type AppStatus struct {
HasConfig bool `json:"hasConfig"`
ConfigPath string `json:"configPath"`
Uploading bool `json:"uploading"`
CriticalConfigError bool `json:"criticalConfigError"`
Error string `json:"error"`
IsFirstStart bool `json:"isFirstStart"`
HasServers bool `json:"hasServers"`
ServerCount int `json:"serverCount"`
ValidServerCount int `json:"validServerCount"`
ConfigValid bool `json:"configValid"`
NeedsConfiguration bool `json:"needsConfiguration"`
Version string `json:"version"`
}
AppStatus represents the current application status
type NntpPoolMetrics ¶ added in v0.0.16
type NntpPoolMetrics struct {
Timestamp string `json:"timestamp"`
ActiveConnections int `json:"activeConnections"`
TotalErrors int64 `json:"totalErrors"`
AvgSpeed float64 `json:"avgSpeed"`
BytesConsumed int64 `json:"bytesConsumed"`
Elapsed string `json:"elapsed"`
ProviderErrors map[string]int64 `json:"providerErrors"`
Providers []NntpProviderMetrics `json:"providers"`
}
NntpPoolMetrics represents NNTP connection pool metrics
type NntpProviderMetrics ¶ added in v0.0.16
type NntpProviderMetrics struct {
Name string `json:"name"`
Host string `json:"host"`
ActiveConnections int `json:"activeConnections"`
MaxConnections int `json:"maxConnections"`
AvailableSlots int `json:"availableSlots"`
TotalErrors int64 `json:"totalErrors"`
AvgSpeed float64 `json:"avgSpeed"`
SpeedEwma float64 `json:"speedEwma"` // recent throughput estimate (bytes/sec), 0 = no sample
BytesConsumed int64 `json:"bytesConsumed"`
Missing int64 `json:"missing"`
PingRTT string `json:"pingRTT"`
TTFB string `json:"ttfb"` // recent time-to-first-byte, "" = no sample
Inflight int `json:"inflight"`
QuotaBytes int64 `json:"quotaBytes"` // 0 = no quota configured
QuotaUsed int64 `json:"quotaUsed"`
QuotaResetAt string `json:"quotaResetAt"` // RFC3339, "" = no period
QuotaExceeded bool `json:"quotaExceeded"`
}
NntpProviderMetrics represents metrics for individual NNTP providers
type PaginatedQueueResult ¶ added in v0.0.26
type PaginatedQueueResult struct {
Items []QueueItem `json:"items"`
TotalItems int `json:"totalItems"`
TotalPages int `json:"totalPages"`
CurrentPage int `json:"currentPage"`
ItemsPerPage int `json:"itemsPerPage"`
HasNext bool `json:"hasNext"`
HasPrev bool `json:"hasPrev"`
}
PaginatedQueueResult contains paginated queue items and metadata
type PaginationParams ¶ added in v0.0.26
type PaginationParams struct {
Page int `json:"page"` // 1-based page number
Limit int `json:"limit"` // Items per page
SortBy string `json:"sortBy"` // Sort field: "created", "priority", "status", "filename", "size"
Order string `json:"order"` // Sort order: "asc", "desc"
Status string `json:"status"` // Status filter: "pending", "complete", "error", or "" for all
}
PaginationParams defines parameters for paginated queries
type ProcessingPauseState ¶ added in v0.0.30
type ProcessingPauseState struct {
Paused bool `json:"paused"`
AutoPaused bool `json:"autoPaused"`
Reason string `json:"reason"`
}
ProcessingPauseState is the payload broadcast with pause-related events. A full snapshot lets the UI render the header without follow-up RPCs.
type ProcessorStatus ¶ added in v0.0.8
type ProcessorStatus struct {
HasProcessor bool `json:"hasProcessor"`
RunningJobs int `json:"runningJobs"`
RunningJobIDs []string `json:"runningJobIDs"`
}
ProcessorStatus represents the current processor status
type QueueItem ¶
type QueueItem struct {
ID string `json:"id"`
Path string `json:"path"`
FileName string `json:"fileName"`
Size int64 `json:"size"`
Status string `json:"status"`
RetryCount int `json:"retryCount"`
Priority int `json:"priority"`
ErrorMessage *string `json:"errorMessage"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CompletedAt *time.Time `json:"completedAt"`
NzbPath *string `json:"nzbPath"`
VerificationStatus *string `json:"verificationStatus"`
}
QueueItem represents a queue item for the frontend - matches queue.QueueItem
type QueueStats ¶ added in v0.0.8
type QueueStats struct {
Total int `json:"total"`
Pending int `json:"pending"`
Running int `json:"running"`
Complete int `json:"complete"`
Error int `json:"error"`
PendingVerification int `json:"pendingVerification"`
VerificationFailed int `json:"verificationFailed"`
}
QueueStats represents queue statistics
type ServerData ¶ added in v0.0.7
type ServerData struct {
Name string `json:"name"`
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
SSL bool `json:"ssl"`
MaxConnections int `json:"maxConnections"`
Role string `json:"role"` // "upload" | "verify" | "" (defaults to upload)
}
ServerData represents the server configuration data from the frontend
type SetupWizardData ¶ added in v0.0.7
type SetupWizardData struct {
Servers []ServerData `json:"servers"`
OutputDirectory string `json:"outputDirectory"`
WatchDirectory string `json:"watchDirectory"`
}
SetupWizardData represents the complete setup wizard data from the frontend
type TransferRuntimeMetrics ¶ added in v0.0.30
type TransferRuntimeMetrics struct {
UploadActiveWorkers int64 `json:"uploadActiveWorkers"`
UploadQueuedWorkers int64 `json:"uploadQueuedWorkers"`
UploadWorkerCount int64 `json:"uploadWorkerCount"`
UploadReservedBytes int64 `json:"uploadReservedBytes"`
UploadBudgetBytes int64 `json:"uploadBudgetBytes"`
Par2ActiveJobs int64 `json:"par2ActiveJobs"`
Par2QueuedJobs int64 `json:"par2QueuedJobs"`
Par2Capacity int `json:"par2Capacity"`
}
TransferRuntimeMetrics is the backend-facing view of process-wide upload/PAR2 scheduler metrics for the diagnostics dashboard.
type ValidationResult ¶ added in v0.0.7
ValidationResult represents the result of server validation