Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateAPIKey() (string, error)
- func HashAPIKey(key string) string
- func NormalizeCrossSeedCompletionSettings(settings *CrossSeedCompletionSettings)
- type APIKey
- type APIKeyStore
- func (s *APIKeyStore) Create(ctx context.Context, name string) (string, *APIKey, error)
- func (s *APIKeyStore) Delete(ctx context.Context, id int) error
- func (s *APIKeyStore) GetByHash(ctx context.Context, keyHash string) (*APIKey, error)
- func (s *APIKeyStore) List(ctx context.Context) ([]*APIKey, error)
- func (s *APIKeyStore) UpdateLastUsed(ctx context.Context, id int) error
- func (s *APIKeyStore) ValidateAPIKey(ctx context.Context, rawKey string) (*APIKey, error)
- type BackupItem
- type BackupRun
- type BackupRunKind
- type BackupRunStatus
- type BackupSettings
- type BackupStore
- func (s *BackupStore) CleanupRun(ctx context.Context, runID int64) error
- func (s *BackupStore) CleanupRuns(ctx context.Context, runIDs []int64) error
- func (s *BackupStore) CountBlobReferences(ctx context.Context, relPath string) (int, error)
- func (s *BackupStore) CountBlobReferencesBatch(ctx context.Context, relPaths []string) (map[string]int, error)
- func (s *BackupStore) CountRunsByKind(ctx context.Context, instanceID int, kind BackupRunKind) (int, error)
- func (s *BackupStore) CreateRun(ctx context.Context, run *BackupRun) error
- func (s *BackupStore) DeleteItemsByRunIDs(ctx context.Context, runIDs []int64) error
- func (s *BackupStore) DeleteRun(ctx context.Context, runID int64) error
- func (s *BackupStore) DeleteRunsByIDs(ctx context.Context, runIDs []int64) error
- func (s *BackupStore) DeleteRunsOlderThan(ctx context.Context, instanceID int, kind BackupRunKind, keep int) ([]int64, error)
- func (s *BackupStore) FindCachedTorrentBlob(ctx context.Context, instanceID int, hash string) (*string, error)
- func (s *BackupStore) FindIncompleteRuns(ctx context.Context) ([]*BackupRun, error)
- func (s *BackupStore) GetInstanceName(ctx context.Context, instanceID int) (string, error)
- func (s *BackupStore) GetItemByHash(ctx context.Context, runID int64, hash string) (*BackupItem, error)
- func (s *BackupStore) GetRun(ctx context.Context, runID int64) (*BackupRun, error)
- func (s *BackupStore) GetRuns(ctx context.Context, runIDs []int64) ([]*BackupRun, error)
- func (s *BackupStore) GetSettings(ctx context.Context, instanceID int) (*BackupSettings, error)
- func (s *BackupStore) InsertItems(ctx context.Context, runID int64, items []BackupItem) error
- func (s *BackupStore) LatestRunByKind(ctx context.Context, instanceID int, kind BackupRunKind) (*BackupRun, error)
- func (s *BackupStore) ListEnabledSettings(ctx context.Context) ([]*BackupSettings, error)
- func (s *BackupStore) ListItems(ctx context.Context, runID int64) ([]*BackupItem, error)
- func (s *BackupStore) ListItemsForRuns(ctx context.Context, runIDs []int64) ([]*BackupItem, error)
- func (s *BackupStore) ListRunIDs(ctx context.Context, instanceID int) ([]int64, error)
- func (s *BackupStore) ListRuns(ctx context.Context, instanceID int, limit, offset int) ([]*BackupRun, error)
- func (s *BackupStore) ListRunsByKind(ctx context.Context, instanceID int, kind BackupRunKind, limit int) ([]*BackupRun, error)
- func (s *BackupStore) RemoveFailedRunsBefore(ctx context.Context, cutoff time.Time) (int64, error)
- func (s *BackupStore) UpdateMultipleRunsStatus(ctx context.Context, runIDs []int64, status BackupRunStatus, ...) error
- func (s *BackupStore) UpdateRunMetadata(ctx context.Context, runID int64, updateFn func(*BackupRun) error) error
- func (s *BackupStore) UpsertSettings(ctx context.Context, settings *BackupSettings) error
- type CategorySnapshot
- type ClientAPIKey
- type ClientAPIKeyStore
- func (s *ClientAPIKeyStore) Create(ctx context.Context, clientName string, instanceID int) (string, *ClientAPIKey, error)
- func (s *ClientAPIKeyStore) Delete(ctx context.Context, id int) error
- func (s *ClientAPIKeyStore) DeleteByInstanceID(ctx context.Context, instanceID int) error
- func (s *ClientAPIKeyStore) GetAll(ctx context.Context) ([]*ClientAPIKey, error)
- func (s *ClientAPIKeyStore) GetByKeyHash(ctx context.Context, keyHash string) (*ClientAPIKey, error)
- func (s *ClientAPIKeyStore) UpdateLastUsed(ctx context.Context, keyHash string) error
- func (s *ClientAPIKeyStore) ValidateKey(ctx context.Context, rawKey string) (*ClientAPIKey, error)
- type CrossSeedAutomationSettings
- type CrossSeedCompletionSettings
- type CrossSeedFeedItem
- type CrossSeedFeedItemStatus
- type CrossSeedRun
- type CrossSeedRunMode
- type CrossSeedRunResult
- type CrossSeedRunStatus
- type CrossSeedSearchFilters
- type CrossSeedSearchResult
- type CrossSeedSearchRun
- type CrossSeedSearchRunStatus
- type CrossSeedSearchSettings
- type CrossSeedStore
- func (s *CrossSeedStore) CreateRun(ctx context.Context, run *CrossSeedRun) (*CrossSeedRun, error)
- func (s *CrossSeedStore) CreateSearchRun(ctx context.Context, run *CrossSeedSearchRun) (*CrossSeedSearchRun, error)
- func (s *CrossSeedStore) GetLatestRun(ctx context.Context) (*CrossSeedRun, error)
- func (s *CrossSeedStore) GetRun(ctx context.Context, id int64) (*CrossSeedRun, error)
- func (s *CrossSeedStore) GetSearchHistory(ctx context.Context, instanceID int, torrentHash string) (time.Time, bool, error)
- func (s *CrossSeedStore) GetSearchRun(ctx context.Context, id int64) (*CrossSeedSearchRun, error)
- func (s *CrossSeedStore) GetSearchSettings(ctx context.Context) (*CrossSeedSearchSettings, error)
- func (s *CrossSeedStore) GetSettings(ctx context.Context) (*CrossSeedAutomationSettings, error)
- func (s *CrossSeedStore) HasProcessedFeedItem(ctx context.Context, guid string, indexerID int) (bool, CrossSeedFeedItemStatus, error)
- func (s *CrossSeedStore) ListRuns(ctx context.Context, limit, offset int) ([]*CrossSeedRun, error)
- func (s *CrossSeedStore) ListSearchRuns(ctx context.Context, instanceID, limit, offset int) ([]*CrossSeedSearchRun, error)
- func (s *CrossSeedStore) MarkFeedItem(ctx context.Context, item *CrossSeedFeedItem) error
- func (s *CrossSeedStore) PruneFeedItems(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *CrossSeedStore) UpdateRun(ctx context.Context, run *CrossSeedRun) (*CrossSeedRun, error)
- func (s *CrossSeedStore) UpdateSearchRun(ctx context.Context, run *CrossSeedSearchRun) (*CrossSeedSearchRun, error)
- func (s *CrossSeedStore) UpsertSearchHistory(ctx context.Context, instanceID int, torrentHash string, searchedAt time.Time) error
- func (s *CrossSeedStore) UpsertSearchSettings(ctx context.Context, settings *CrossSeedSearchSettings) (*CrossSeedSearchSettings, error)
- func (s *CrossSeedStore) UpsertSettings(ctx context.Context, settings *CrossSeedAutomationSettings) (*CrossSeedAutomationSettings, error)
- type DashboardSettings
- type DashboardSettingsInput
- type DashboardSettingsStore
- type ExternalProgram
- type ExternalProgramCreate
- type ExternalProgramExecute
- type ExternalProgramStore
- func (s *ExternalProgramStore) Create(ctx context.Context, create *ExternalProgramCreate) (*ExternalProgram, error)
- func (s *ExternalProgramStore) Delete(ctx context.Context, id int) error
- func (s *ExternalProgramStore) GetByID(ctx context.Context, id int) (*ExternalProgram, error)
- func (s *ExternalProgramStore) List(ctx context.Context) ([]*ExternalProgram, error)
- func (s *ExternalProgramStore) ListEnabled(ctx context.Context) ([]*ExternalProgram, error)
- func (s *ExternalProgramStore) Update(ctx context.Context, id int, update *ExternalProgramUpdate) (*ExternalProgram, error)
- type ExternalProgramUpdate
- type Instance
- type InstanceError
- type InstanceErrorStore
- type InstanceReannounceSettings
- type InstanceReannounceStore
- func (s *InstanceReannounceStore) Get(ctx context.Context, instanceID int) (*InstanceReannounceSettings, error)
- func (s *InstanceReannounceStore) List(ctx context.Context) ([]*InstanceReannounceSettings, error)
- func (s *InstanceReannounceStore) Upsert(ctx context.Context, settings *InstanceReannounceSettings) (*InstanceReannounceSettings, error)
- type InstanceStore
- func (s *InstanceStore) Create(ctx context.Context, name, rawHost, username, password string, ...) (*Instance, error)
- func (s *InstanceStore) Delete(ctx context.Context, id int) error
- func (s *InstanceStore) Get(ctx context.Context, id int) (*Instance, error)
- func (s *InstanceStore) GetDecryptedBasicPassword(instance *Instance) (*string, error)
- func (s *InstanceStore) GetDecryptedPassword(instance *Instance) (string, error)
- func (s *InstanceStore) List(ctx context.Context) ([]*Instance, error)
- func (s *InstanceStore) SetActiveState(ctx context.Context, id int, active bool) (*Instance, error)
- func (s *InstanceStore) Update(ctx context.Context, id int, name, rawHost, username, password string, ...) (*Instance, error)
- func (s *InstanceStore) UpdateOrder(ctx context.Context, instanceIDs []int) error
- type LicenseInfo
- type PathMapping
- type ProductLicense
- type TorznabBackend
- type TorznabIndexer
- type TorznabIndexerCapability
- type TorznabIndexerCategory
- type TorznabIndexerCooldown
- type TorznabIndexerError
- type TorznabIndexerHealth
- type TorznabIndexerLatency
- type TorznabIndexerLatencyStats
- type TorznabIndexerStore
- func (s *TorznabIndexerStore) CleanupOldLatency(ctx context.Context, olderThan time.Duration) (int64, error)
- func (s *TorznabIndexerStore) Create(ctx context.Context, name, baseURL, apiKey string, enabled bool, ...) (*TorznabIndexer, error)
- func (s *TorznabIndexerStore) CreateWithIndexerID(ctx context.Context, name, baseURL, indexerID, apiKey string, enabled bool, ...) (*TorznabIndexer, error)
- func (s *TorznabIndexerStore) Delete(ctx context.Context, id int) error
- func (s *TorznabIndexerStore) DeleteRateLimitCooldown(ctx context.Context, indexerID int) error
- func (s *TorznabIndexerStore) Get(ctx context.Context, id int) (*TorznabIndexer, error)
- func (s *TorznabIndexerStore) GetAllHealth(ctx context.Context) ([]TorznabIndexerHealth, error)
- func (s *TorznabIndexerStore) GetCapabilities(ctx context.Context, indexerID int) ([]string, error)
- func (s *TorznabIndexerStore) GetCategories(ctx context.Context, indexerID int) ([]TorznabIndexerCategory, error)
- func (s *TorznabIndexerStore) GetDecryptedAPIKey(indexer *TorznabIndexer) (string, error)
- func (s *TorznabIndexerStore) GetHealth(ctx context.Context, indexerID int) (*TorznabIndexerHealth, error)
- func (s *TorznabIndexerStore) GetLatencyStats(ctx context.Context, indexerID int) ([]TorznabIndexerLatencyStats, error)
- func (s *TorznabIndexerStore) GetRecentErrors(ctx context.Context, indexerID int, limit int) ([]TorznabIndexerError, error)
- func (s *TorznabIndexerStore) List(ctx context.Context) ([]*TorznabIndexer, error)
- func (s *TorznabIndexerStore) ListEnabled(ctx context.Context) ([]*TorznabIndexer, error)
- func (s *TorznabIndexerStore) ListRateLimitCooldowns(ctx context.Context) ([]TorznabIndexerCooldown, error)
- func (s *TorznabIndexerStore) RecordError(ctx context.Context, indexerID int, errorMessage, errorCode string) error
- func (s *TorznabIndexerStore) RecordLatency(ctx context.Context, indexerID int, operationType string, latencyMs int, ...) error
- func (s *TorznabIndexerStore) ResolveErrors(ctx context.Context, indexerID int) error
- func (s *TorznabIndexerStore) SetCapabilities(ctx context.Context, indexerID int, capabilities []string) error
- func (s *TorznabIndexerStore) SetCategories(ctx context.Context, indexerID int, categories []TorznabIndexerCategory) error
- func (s *TorznabIndexerStore) Test(ctx context.Context, baseURL, apiKey string) error
- func (s *TorznabIndexerStore) Update(ctx context.Context, id int, params TorznabIndexerUpdateParams) (*TorznabIndexer, error)
- func (s *TorznabIndexerStore) UpdateTestStatus(ctx context.Context, id int, status string, errorMsg *string) error
- func (s *TorznabIndexerStore) UpsertRateLimitCooldown(ctx context.Context, indexerID int, resumeAt time.Time, cooldown time.Duration, ...) error
- type TorznabIndexerUpdateParams
- type TorznabRecentSearch
- type TorznabSearchCacheEntry
- type TorznabSearchCacheSettings
- type TorznabSearchCacheStats
- type TorznabSearchCacheStore
- func (s *TorznabSearchCacheStore) CleanupExpired(ctx context.Context) (int64, error)
- func (s *TorznabSearchCacheStore) Fetch(ctx context.Context, cacheKey string) (*TorznabSearchCacheEntry, bool, error)
- func (s *TorznabSearchCacheStore) FindActiveByScopeAndQuery(ctx context.Context, scope string, query string) ([]*TorznabSearchCacheEntry, error)
- func (s *TorznabSearchCacheStore) Flush(ctx context.Context) (int64, error)
- func (s *TorznabSearchCacheStore) GetSettings(ctx context.Context) (*TorznabSearchCacheSettings, error)
- func (s *TorznabSearchCacheStore) InvalidateByIndexerIDs(ctx context.Context, indexerIDs []int) (int64, error)
- func (s *TorznabSearchCacheStore) RebaseTTL(ctx context.Context, ttlMinutes int) (int64, error)
- func (s *TorznabSearchCacheStore) RecentSearches(ctx context.Context, scope string, limit int) ([]*TorznabRecentSearch, error)
- func (s *TorznabSearchCacheStore) Stats(ctx context.Context) (*TorznabSearchCacheStats, error)
- func (s *TorznabSearchCacheStore) Store(ctx context.Context, entry *TorznabSearchCacheEntry) error
- func (s *TorznabSearchCacheStore) Touch(ctx context.Context, id int64)
- func (s *TorznabSearchCacheStore) UpdateSettings(ctx context.Context, ttlMinutes int) (*TorznabSearchCacheSettings, error)
- type TorznabTorrentCacheEntry
- type TorznabTorrentCacheStore
- func (s *TorznabTorrentCacheStore) Cleanup(ctx context.Context, olderThan time.Duration) (int64, error)
- func (s *TorznabTorrentCacheStore) Fetch(ctx context.Context, indexerID int, cacheKey string, maxAge time.Duration) ([]byte, bool, error)
- func (s *TorznabTorrentCacheStore) Store(ctx context.Context, entry *TorznabTorrentCacheEntry) error
- type TrackerCustomization
- type TrackerCustomizationStore
- func (s *TrackerCustomizationStore) Create(ctx context.Context, c *TrackerCustomization) (*TrackerCustomization, error)
- func (s *TrackerCustomizationStore) Delete(ctx context.Context, id int) error
- func (s *TrackerCustomizationStore) Get(ctx context.Context, id int) (*TrackerCustomization, error)
- func (s *TrackerCustomizationStore) List(ctx context.Context) ([]*TrackerCustomization, error)
- func (s *TrackerCustomizationStore) Update(ctx context.Context, c *TrackerCustomization) (*TrackerCustomization, error)
- type TrackerRule
- type TrackerRuleStore
- func (s *TrackerRuleStore) Create(ctx context.Context, rule *TrackerRule) (*TrackerRule, error)
- func (s *TrackerRuleStore) Delete(ctx context.Context, instanceID int, id int) error
- func (s *TrackerRuleStore) Get(ctx context.Context, id int) (*TrackerRule, error)
- func (s *TrackerRuleStore) ListByInstance(ctx context.Context, instanceID int) ([]*TrackerRule, error)
- func (s *TrackerRuleStore) Reorder(ctx context.Context, instanceID int, orderedIDs []int) error
- func (s *TrackerRuleStore) Update(ctx context.Context, rule *TrackerRule) (*TrackerRule, error)
- type User
- type UserStore
- func (s *UserStore) Create(ctx context.Context, username, passwordHash string) (*User, error)
- func (s *UserStore) Exists(ctx context.Context) (bool, error)
- func (s *UserStore) Get(ctx context.Context) (*User, error)
- func (s *UserStore) GetByUsername(ctx context.Context, username string) (*User, error)
- func (s *UserStore) UpdatePassword(ctx context.Context, passwordHash string) error
Constants ¶
const ( ErrorTypeConnection = "connection" ErrorTypeAuthentication = "authentication" ErrorTypeBan = "ban" ErrorTypeAPI = "api" )
Error types for categorization
const ( LicenseStatusActive = "active" LicenseStatusInvalid = "invalid" )
LicenseStatus constants
Variables ¶
var ( ErrTorznabIndexerNotFound = errors.New("torznab indexer not found") ErrTorznabIndexerIDRequired = errors.New("indexer_id is required for prowlarr backends") )
var DefaultSectionOrder = []string{"server-stats", "tracker-breakdown", "global-stats", "instances"}
Default section order
var DefaultSectionVisibility = map[string]bool{ "server-stats": true, "tracker-breakdown": true, "global-stats": true, "instances": true, }
Default section visibility (all visible)
var ErrAPIKeyNotFound = errors.New("api key not found")
var ErrClientAPIKeyNotFound = errors.New("client api key not found")
var ErrExternalProgramNotFound = errors.New("external program not found")
var ErrInstanceNotFound = errors.New("instance not found")
var ErrInvalidAPIKey = errors.New("invalid api key")
var (
ErrLicenseNotFound = errors.New("license not found")
)
var ErrUserAlreadyExists = errors.New("user already exists")
var ErrUserNotFound = errors.New("user not found")
Functions ¶
func HashAPIKey ¶
HashAPIKey creates a SHA256 hash of the API key
func NormalizeCrossSeedCompletionSettings ¶ added in v1.8.0
func NormalizeCrossSeedCompletionSettings(settings *CrossSeedCompletionSettings)
NormalizeCrossSeedCompletionSettings trims, deduplicates, and ensures slices are non-nil.
Types ¶
type APIKeyStore ¶
type APIKeyStore struct {
// contains filtered or unexported fields
}
func NewAPIKeyStore ¶
func NewAPIKeyStore(db dbinterface.Querier) *APIKeyStore
func (*APIKeyStore) UpdateLastUsed ¶
func (s *APIKeyStore) UpdateLastUsed(ctx context.Context, id int) error
func (*APIKeyStore) ValidateAPIKey ¶
ValidateAPIKey validates a raw API key and returns the associated APIKey if valid
type BackupItem ¶ added in v1.5.0
type BackupItem struct {
ID int64 `json:"id"`
RunID int64 `json:"runId"`
TorrentHash string `json:"torrentHash"`
Name string `json:"name"`
Category *string `json:"category,omitempty"`
SizeBytes int64 `json:"sizeBytes"`
ArchiveRelPath *string `json:"archiveRelPath,omitempty"`
InfoHashV1 *string `json:"infohashV1,omitempty"`
InfoHashV2 *string `json:"infohashV2,omitempty"`
Tags *string `json:"tags,omitempty"`
TorrentBlobPath *string `json:"torrentBlobPath,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
type BackupRun ¶ added in v1.5.0
type BackupRun struct {
ID int64 `json:"id"`
InstanceID int `json:"instanceId"`
Kind BackupRunKind `json:"kind"`
Status BackupRunStatus `json:"status"`
RequestedBy string `json:"requestedBy"`
RequestedAt time.Time `json:"requestedAt"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
ArchivePath *string `json:"archivePath,omitempty"`
ManifestPath *string `json:"manifestPath,omitempty"`
TotalBytes int64 `json:"totalBytes"`
TorrentCount int `json:"torrentCount"`
CategoryCounts map[string]int `json:"categoryCounts,omitempty"`
ErrorMessage *string `json:"errorMessage,omitempty"`
Categories map[string]CategorySnapshot `json:"categories,omitempty"`
Tags []string `json:"tags,omitempty"`
// contains filtered or unexported fields
}
type BackupRunKind ¶ added in v1.5.0
type BackupRunKind string
const ( BackupRunKindManual BackupRunKind = "manual" BackupRunKindHourly BackupRunKind = "hourly" BackupRunKindDaily BackupRunKind = "daily" BackupRunKindWeekly BackupRunKind = "weekly" BackupRunKindMonthly BackupRunKind = "monthly" )
type BackupRunStatus ¶ added in v1.5.0
type BackupRunStatus string
const ( BackupRunStatusPending BackupRunStatus = "pending" BackupRunStatusRunning BackupRunStatus = "running" BackupRunStatusSuccess BackupRunStatus = "success" BackupRunStatusFailed BackupRunStatus = "failed" BackupRunStatusCanceled BackupRunStatus = "canceled" )
type BackupSettings ¶ added in v1.5.0
type BackupSettings struct {
InstanceID int `json:"instanceId"`
Enabled bool `json:"enabled"`
HourlyEnabled bool `json:"hourlyEnabled"`
DailyEnabled bool `json:"dailyEnabled"`
WeeklyEnabled bool `json:"weeklyEnabled"`
MonthlyEnabled bool `json:"monthlyEnabled"`
KeepHourly int `json:"keepHourly"`
KeepDaily int `json:"keepDaily"`
KeepWeekly int `json:"keepWeekly"`
KeepMonthly int `json:"keepMonthly"`
IncludeCategories bool `json:"includeCategories"`
IncludeTags bool `json:"includeTags"`
CustomPath *string `json:"customPath,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func DefaultBackupSettings ¶ added in v1.5.0
func DefaultBackupSettings(instanceID int) *BackupSettings
type BackupStore ¶ added in v1.5.0
type BackupStore struct {
// contains filtered or unexported fields
}
func NewBackupStore ¶ added in v1.5.0
func NewBackupStore(db dbinterface.Querier) *BackupStore
func (*BackupStore) CleanupRun ¶ added in v1.5.0
func (s *BackupStore) CleanupRun(ctx context.Context, runID int64) error
func (*BackupStore) CleanupRuns ¶ added in v1.8.0
func (s *BackupStore) CleanupRuns(ctx context.Context, runIDs []int64) error
func (*BackupStore) CountBlobReferences ¶ added in v1.5.0
func (*BackupStore) CountBlobReferencesBatch ¶ added in v1.8.0
func (*BackupStore) CountRunsByKind ¶ added in v1.5.0
func (s *BackupStore) CountRunsByKind(ctx context.Context, instanceID int, kind BackupRunKind) (int, error)
func (*BackupStore) CreateRun ¶ added in v1.5.0
func (s *BackupStore) CreateRun(ctx context.Context, run *BackupRun) error
func (*BackupStore) DeleteItemsByRunIDs ¶ added in v1.5.0
func (s *BackupStore) DeleteItemsByRunIDs(ctx context.Context, runIDs []int64) error
func (*BackupStore) DeleteRun ¶ added in v1.5.0
func (s *BackupStore) DeleteRun(ctx context.Context, runID int64) error
func (*BackupStore) DeleteRunsByIDs ¶ added in v1.5.0
func (s *BackupStore) DeleteRunsByIDs(ctx context.Context, runIDs []int64) error
func (*BackupStore) DeleteRunsOlderThan ¶ added in v1.5.0
func (s *BackupStore) DeleteRunsOlderThan(ctx context.Context, instanceID int, kind BackupRunKind, keep int) ([]int64, error)
func (*BackupStore) FindCachedTorrentBlob ¶ added in v1.5.0
func (*BackupStore) FindIncompleteRuns ¶ added in v1.6.0
func (s *BackupStore) FindIncompleteRuns(ctx context.Context) ([]*BackupRun, error)
FindIncompleteRuns returns all backup runs that are in pending or running status. These are runs that were interrupted by a restart or crash.
func (*BackupStore) GetInstanceName ¶ added in v1.5.0
func (*BackupStore) GetItemByHash ¶ added in v1.5.0
func (s *BackupStore) GetItemByHash(ctx context.Context, runID int64, hash string) (*BackupItem, error)
func (*BackupStore) GetSettings ¶ added in v1.5.0
func (s *BackupStore) GetSettings(ctx context.Context, instanceID int) (*BackupSettings, error)
func (*BackupStore) InsertItems ¶ added in v1.5.0
func (s *BackupStore) InsertItems(ctx context.Context, runID int64, items []BackupItem) error
func (*BackupStore) LatestRunByKind ¶ added in v1.5.0
func (s *BackupStore) LatestRunByKind(ctx context.Context, instanceID int, kind BackupRunKind) (*BackupRun, error)
func (*BackupStore) ListEnabledSettings ¶ added in v1.5.0
func (s *BackupStore) ListEnabledSettings(ctx context.Context) ([]*BackupSettings, error)
func (*BackupStore) ListItems ¶ added in v1.5.0
func (s *BackupStore) ListItems(ctx context.Context, runID int64) ([]*BackupItem, error)
func (*BackupStore) ListItemsForRuns ¶ added in v1.8.0
func (s *BackupStore) ListItemsForRuns(ctx context.Context, runIDs []int64) ([]*BackupItem, error)
func (*BackupStore) ListRunIDs ¶ added in v1.5.0
func (*BackupStore) ListRunsByKind ¶ added in v1.5.0
func (s *BackupStore) ListRunsByKind(ctx context.Context, instanceID int, kind BackupRunKind, limit int) ([]*BackupRun, error)
func (*BackupStore) RemoveFailedRunsBefore ¶ added in v1.5.0
RemoveFailedRunsBefore deletes failed runs older than the provided cutoff and returns the number of rows affected.
func (*BackupStore) UpdateMultipleRunsStatus ¶ added in v1.7.0
func (s *BackupStore) UpdateMultipleRunsStatus(ctx context.Context, runIDs []int64, status BackupRunStatus, completedAt *time.Time, errorMessage *string) error
UpdateMultipleRunsStatus updates the status of multiple backup runs in a single transaction
func (*BackupStore) UpdateRunMetadata ¶ added in v1.5.0
func (*BackupStore) UpsertSettings ¶ added in v1.5.0
func (s *BackupStore) UpsertSettings(ctx context.Context, settings *BackupSettings) error
type CategorySnapshot ¶ added in v1.5.0
type CategorySnapshot struct {
SavePath string `json:"savePath,omitempty"`
}
type ClientAPIKey ¶ added in v1.0.0
type ClientAPIKeyStore ¶ added in v1.0.0
type ClientAPIKeyStore struct {
// contains filtered or unexported fields
}
func NewClientAPIKeyStore ¶ added in v1.0.0
func NewClientAPIKeyStore(db dbinterface.Querier) *ClientAPIKeyStore
func (*ClientAPIKeyStore) Create ¶ added in v1.0.0
func (s *ClientAPIKeyStore) Create(ctx context.Context, clientName string, instanceID int) (string, *ClientAPIKey, error)
func (*ClientAPIKeyStore) Delete ¶ added in v1.0.0
func (s *ClientAPIKeyStore) Delete(ctx context.Context, id int) error
func (*ClientAPIKeyStore) DeleteByInstanceID ¶ added in v1.0.0
func (s *ClientAPIKeyStore) DeleteByInstanceID(ctx context.Context, instanceID int) error
func (*ClientAPIKeyStore) GetAll ¶ added in v1.0.0
func (s *ClientAPIKeyStore) GetAll(ctx context.Context) ([]*ClientAPIKey, error)
func (*ClientAPIKeyStore) GetByKeyHash ¶ added in v1.0.0
func (s *ClientAPIKeyStore) GetByKeyHash(ctx context.Context, keyHash string) (*ClientAPIKey, error)
func (*ClientAPIKeyStore) UpdateLastUsed ¶ added in v1.0.0
func (s *ClientAPIKeyStore) UpdateLastUsed(ctx context.Context, keyHash string) error
func (*ClientAPIKeyStore) ValidateKey ¶ added in v1.0.0
func (s *ClientAPIKeyStore) ValidateKey(ctx context.Context, rawKey string) (*ClientAPIKey, error)
type CrossSeedAutomationSettings ¶ added in v1.8.0
type CrossSeedAutomationSettings struct {
// RSS Automation settings
Enabled bool `json:"enabled"` // Enable/disable RSS automation
RunIntervalMinutes int `json:"runIntervalMinutes"` // RSS: interval between RSS feed polls (min: 30 minutes, default: 120)
StartPaused bool `json:"startPaused"` // RSS: start added torrents paused
Category *string `json:"category,omitempty"` // RSS: category for added torrents
IgnorePatterns []string `json:"ignorePatterns"` // RSS: file patterns to ignore
TargetInstanceIDs []int `json:"targetInstanceIds"` // RSS: instances to add cross-seeds to
TargetIndexerIDs []int `json:"targetIndexerIds"` // RSS: indexers to poll for RSS feeds
MaxResultsPerRun int `json:"maxResultsPerRun"` // Deprecated: automation processes full feeds; retained for backward compatibility
// Global cross-seed settings (apply to both RSS Automation and Seeded Torrent Search)
FindIndividualEpisodes bool `json:"findIndividualEpisodes"` // Match season packs with individual episodes
SizeMismatchTolerancePercent float64 `json:"sizeMismatchTolerancePercent"` // Size tolerance for matching (default: 5%)
UseCategoryFromIndexer bool `json:"useCategoryFromIndexer"` // Use indexer name as category for cross-seeds
RunExternalProgramID *int `json:"runExternalProgramId"` // Optional external program to run after successful cross-seed injection
Completion CrossSeedCompletionSettings `json:"completion"` // Automatic search on torrent completion
// Source-specific tagging: tags applied based on how the cross-seed was discovered.
// Each defaults to ["cross-seed"]. Users can add source-specific tags like "rss", "seeded-search", etc.
RSSAutomationTags []string `json:"rssAutomationTags"` // Tags for RSS automation results
SeededSearchTags []string `json:"seededSearchTags"` // Tags for seeded torrent search results
CompletionSearchTags []string `json:"completionSearchTags"` // Tags for completion-triggered search results
WebhookTags []string `json:"webhookTags"` // Tags for /apply webhook results
InheritSourceTags bool `json:"inheritSourceTags"` // Also copy tags from the matched source torrent
// Category isolation: add .cross suffix to prevent *arr import loops
UseCrossCategorySuffix bool `json:"useCrossCategorySuffix"` // Add .cross suffix to categories (e.g., movies → movies.cross)
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
CrossSeedAutomationSettings controls automatic cross-seed behaviour. Contains both RSS Automation-specific settings and global cross-seed settings.
func DefaultCrossSeedAutomationSettings ¶ added in v1.8.0
func DefaultCrossSeedAutomationSettings() *CrossSeedAutomationSettings
DefaultCrossSeedAutomationSettings returns sensible defaults for RSS automation. RSS automation is disabled by default with a 2-hour interval and 50 results per run.
type CrossSeedCompletionSettings ¶ added in v1.8.0
type CrossSeedCompletionSettings struct {
Enabled bool `json:"enabled"`
Categories []string `json:"categories"`
Tags []string `json:"tags"`
ExcludeCategories []string `json:"excludeCategories"`
ExcludeTags []string `json:"excludeTags"`
}
CrossSeedCompletionSettings controls automatic searches triggered when torrents complete.
func DefaultCrossSeedCompletionSettings ¶ added in v1.8.0
func DefaultCrossSeedCompletionSettings() CrossSeedCompletionSettings
DefaultCrossSeedCompletionSettings returns defaults for completion-triggered automation.
type CrossSeedFeedItem ¶ added in v1.8.0
type CrossSeedFeedItem struct {
GUID string `json:"guid"`
IndexerID int `json:"indexerId"`
Title string `json:"title"`
FirstSeenAt time.Time `json:"firstSeenAt"`
LastSeenAt time.Time `json:"lastSeenAt"`
LastStatus CrossSeedFeedItemStatus `json:"lastStatus"`
LastRunID *int64 `json:"lastRunId,omitempty"`
InfoHash *string `json:"infoHash,omitempty"`
}
CrossSeedFeedItem tracks GUIDs pulled from indexers to avoid duplicates.
type CrossSeedFeedItemStatus ¶ added in v1.8.0
type CrossSeedFeedItemStatus string
CrossSeedFeedItemStatus tracks processing state for feed items.
const ( CrossSeedFeedItemStatusPending CrossSeedFeedItemStatus = "pending" CrossSeedFeedItemStatusProcessed CrossSeedFeedItemStatus = "processed" CrossSeedFeedItemStatusSkipped CrossSeedFeedItemStatus = "skipped" CrossSeedFeedItemStatusFailed CrossSeedFeedItemStatus = "failed" )
type CrossSeedRun ¶ added in v1.8.0
type CrossSeedRun struct {
ID int64 `json:"id"`
TriggeredBy string `json:"triggeredBy"`
Mode CrossSeedRunMode `json:"mode"`
Status CrossSeedRunStatus `json:"status"`
StartedAt time.Time `json:"startedAt"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
TotalFeedItems int `json:"totalFeedItems"`
CandidatesFound int `json:"candidatesFound"`
TorrentsAdded int `json:"torrentsAdded"`
TorrentsFailed int `json:"torrentsFailed"`
TorrentsSkipped int `json:"torrentsSkipped"`
Message *string `json:"message,omitempty"`
ErrorMessage *string `json:"errorMessage,omitempty"`
Results []CrossSeedRunResult `json:"results,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
CrossSeedRun stores the persisted automation run metadata.
type CrossSeedRunMode ¶ added in v1.8.0
type CrossSeedRunMode string
CrossSeedRunMode indicates how the run was triggered.
const ( CrossSeedRunModeAuto CrossSeedRunMode = "auto" CrossSeedRunModeManual CrossSeedRunMode = "manual" )
type CrossSeedRunResult ¶ added in v1.8.0
type CrossSeedRunResult struct {
InstanceID int `json:"instanceId"`
InstanceName string `json:"instanceName"`
Success bool `json:"success"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
MatchedTorrentHash *string `json:"matchedTorrentHash,omitempty"`
MatchedTorrentName *string `json:"matchedTorrentName,omitempty"`
}
CrossSeedRunResult summarises the outcome for a single instance.
type CrossSeedRunStatus ¶ added in v1.8.0
type CrossSeedRunStatus string
CrossSeedRunStatus indicates the outcome of an automation run.
const ( CrossSeedRunStatusPending CrossSeedRunStatus = "pending" CrossSeedRunStatusRunning CrossSeedRunStatus = "running" CrossSeedRunStatusSuccess CrossSeedRunStatus = "success" CrossSeedRunStatusPartial CrossSeedRunStatus = "partial" CrossSeedRunStatusFailed CrossSeedRunStatus = "failed" )
type CrossSeedSearchFilters ¶ added in v1.8.0
type CrossSeedSearchFilters struct {
Categories []string `json:"categories"`
Tags []string `json:"tags"`
}
CrossSeedSearchFilters capture how torrents are selected for automated search runs.
type CrossSeedSearchResult ¶ added in v1.8.0
type CrossSeedSearchResult struct {
TorrentHash string `json:"torrentHash"`
TorrentName string `json:"torrentName"`
IndexerName string `json:"indexerName"`
ReleaseTitle string `json:"releaseTitle"`
Added bool `json:"added"`
Message string `json:"message,omitempty"`
ProcessedAt time.Time `json:"processedAt"`
}
CrossSeedSearchResult records the outcome of processing a single torrent during a search run.
type CrossSeedSearchRun ¶ added in v1.8.0
type CrossSeedSearchRun struct {
ID int64 `json:"id"`
InstanceID int `json:"instanceId"`
Status CrossSeedSearchRunStatus `json:"status"`
StartedAt time.Time `json:"startedAt"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
TotalTorrents int `json:"totalTorrents"`
Processed int `json:"processed"`
TorrentsAdded int `json:"torrentsAdded"`
TorrentsFailed int `json:"torrentsFailed"`
TorrentsSkipped int `json:"torrentsSkipped"`
Message *string `json:"message,omitempty"`
ErrorMessage *string `json:"errorMessage,omitempty"`
Filters CrossSeedSearchFilters `json:"filters"`
IndexerIDs []int `json:"indexerIds"`
IntervalSeconds int `json:"intervalSeconds"`
CooldownMinutes int `json:"cooldownMinutes"`
Results []CrossSeedSearchResult `json:"results"`
CreatedAt time.Time `json:"createdAt"`
}
CrossSeedSearchRun stores metadata for library search automation runs.
type CrossSeedSearchRunStatus ¶ added in v1.8.0
type CrossSeedSearchRunStatus string
CrossSeedSearchRunStatus represents the lifecycle state of an automated search pass.
const ( CrossSeedSearchRunStatusRunning CrossSeedSearchRunStatus = "running" CrossSeedSearchRunStatusSuccess CrossSeedSearchRunStatus = "success" CrossSeedSearchRunStatusFailed CrossSeedSearchRunStatus = "failed" CrossSeedSearchRunStatusCanceled CrossSeedSearchRunStatus = "canceled" )
type CrossSeedSearchSettings ¶ added in v1.8.0
type CrossSeedSearchSettings struct {
InstanceID *int `json:"instanceId"`
Categories []string `json:"categories"`
Tags []string `json:"tags"`
IndexerIDs []int `json:"indexerIds"`
IntervalSeconds int `json:"intervalSeconds"`
CooldownMinutes int `json:"cooldownMinutes"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
CrossSeedSearchSettings stores defaults for manual seeded torrent searches.
func DefaultCrossSeedSearchSettings ¶ added in v1.8.0
func DefaultCrossSeedSearchSettings() *CrossSeedSearchSettings
DefaultCrossSeedSearchSettings returns defaults for seeded torrent searches.
type CrossSeedStore ¶ added in v1.8.0
type CrossSeedStore struct {
// contains filtered or unexported fields
}
CrossSeedStore persists automation settings, runs, and feed items.
func NewCrossSeedStore ¶ added in v1.8.0
func NewCrossSeedStore(db dbinterface.Querier) *CrossSeedStore
NewCrossSeedStore constructs a new automation store.
func (*CrossSeedStore) CreateRun ¶ added in v1.8.0
func (s *CrossSeedStore) CreateRun(ctx context.Context, run *CrossSeedRun) (*CrossSeedRun, error)
CreateRun inserts a new automation run record.
func (*CrossSeedStore) CreateSearchRun ¶ added in v1.8.0
func (s *CrossSeedStore) CreateSearchRun(ctx context.Context, run *CrossSeedSearchRun) (*CrossSeedSearchRun, error)
CreateSearchRun inserts a new record for a search automation run.
func (*CrossSeedStore) GetLatestRun ¶ added in v1.8.0
func (s *CrossSeedStore) GetLatestRun(ctx context.Context) (*CrossSeedRun, error)
GetLatestRun returns the most recent automation run.
func (*CrossSeedStore) GetRun ¶ added in v1.8.0
func (s *CrossSeedStore) GetRun(ctx context.Context, id int64) (*CrossSeedRun, error)
GetRun fetches a single run by ID.
func (*CrossSeedStore) GetSearchHistory ¶ added in v1.8.0
func (s *CrossSeedStore) GetSearchHistory(ctx context.Context, instanceID int, torrentHash string) (time.Time, bool, error)
GetSearchHistory returns the last time a torrent was searched.
func (*CrossSeedStore) GetSearchRun ¶ added in v1.8.0
func (s *CrossSeedStore) GetSearchRun(ctx context.Context, id int64) (*CrossSeedSearchRun, error)
GetSearchRun loads a specific search run by ID.
func (*CrossSeedStore) GetSearchSettings ¶ added in v1.8.0
func (s *CrossSeedStore) GetSearchSettings(ctx context.Context) (*CrossSeedSearchSettings, error)
GetSearchSettings returns the stored seeded search defaults, or defaults when unset.
func (*CrossSeedStore) GetSettings ¶ added in v1.8.0
func (s *CrossSeedStore) GetSettings(ctx context.Context) (*CrossSeedAutomationSettings, error)
GetSettings returns the current automation settings or defaults.
func (*CrossSeedStore) HasProcessedFeedItem ¶ added in v1.8.0
func (s *CrossSeedStore) HasProcessedFeedItem(ctx context.Context, guid string, indexerID int) (bool, CrossSeedFeedItemStatus, error)
HasProcessedFeedItem reports whether a GUID/indexer pair has been handled.
func (*CrossSeedStore) ListRuns ¶ added in v1.8.0
func (s *CrossSeedStore) ListRuns(ctx context.Context, limit, offset int) ([]*CrossSeedRun, error)
ListRuns returns automation run history.
func (*CrossSeedStore) ListSearchRuns ¶ added in v1.8.0
func (s *CrossSeedStore) ListSearchRuns(ctx context.Context, instanceID, limit, offset int) ([]*CrossSeedSearchRun, error)
ListSearchRuns returns search automation history for an instance.
func (*CrossSeedStore) MarkFeedItem ¶ added in v1.8.0
func (s *CrossSeedStore) MarkFeedItem(ctx context.Context, item *CrossSeedFeedItem) error
MarkFeedItem updates the state of a feed item.
func (*CrossSeedStore) PruneFeedItems ¶ added in v1.8.0
PruneFeedItems removes processed feed items older than the provided cutoff.
func (*CrossSeedStore) UpdateRun ¶ added in v1.8.0
func (s *CrossSeedStore) UpdateRun(ctx context.Context, run *CrossSeedRun) (*CrossSeedRun, error)
UpdateRun updates an existing run with final statistics.
func (*CrossSeedStore) UpdateSearchRun ¶ added in v1.8.0
func (s *CrossSeedStore) UpdateSearchRun(ctx context.Context, run *CrossSeedSearchRun) (*CrossSeedSearchRun, error)
UpdateSearchRun updates persisted metadata for a search run.
func (*CrossSeedStore) UpsertSearchHistory ¶ added in v1.8.0
func (s *CrossSeedStore) UpsertSearchHistory(ctx context.Context, instanceID int, torrentHash string, searchedAt time.Time) error
UpsertSearchHistory updates the last searched timestamp for a torrent on an instance.
func (*CrossSeedStore) UpsertSearchSettings ¶ added in v1.8.0
func (s *CrossSeedStore) UpsertSearchSettings(ctx context.Context, settings *CrossSeedSearchSettings) (*CrossSeedSearchSettings, error)
UpsertSearchSettings saves seeded search defaults.
func (*CrossSeedStore) UpsertSettings ¶ added in v1.8.0
func (s *CrossSeedStore) UpsertSettings(ctx context.Context, settings *CrossSeedAutomationSettings) (*CrossSeedAutomationSettings, error)
UpsertSettings saves automation settings and returns the updated value.
type DashboardSettings ¶ added in v1.9.0
type DashboardSettings struct {
ID int `json:"id"`
UserID int `json:"userId"`
SectionVisibility map[string]bool `json:"sectionVisibility"`
SectionOrder []string `json:"sectionOrder"`
SectionCollapsed map[string]bool `json:"sectionCollapsed"`
TrackerBreakdownSortColumn string `json:"trackerBreakdownSortColumn"`
TrackerBreakdownSortDir string `json:"trackerBreakdownSortDirection"`
TrackerBreakdownItemsPerPage int `json:"trackerBreakdownItemsPerPage"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type DashboardSettingsInput ¶ added in v1.9.0
type DashboardSettingsInput struct {
SectionVisibility map[string]bool `json:"sectionVisibility,omitempty"`
SectionOrder []string `json:"sectionOrder,omitempty"`
SectionCollapsed map[string]bool `json:"sectionCollapsed,omitempty"`
TrackerBreakdownSortColumn string `json:"trackerBreakdownSortColumn,omitempty"`
TrackerBreakdownSortDir string `json:"trackerBreakdownSortDirection,omitempty"`
TrackerBreakdownItemsPerPage int `json:"trackerBreakdownItemsPerPage,omitempty"`
}
type DashboardSettingsStore ¶ added in v1.9.0
type DashboardSettingsStore struct {
// contains filtered or unexported fields
}
func NewDashboardSettingsStore ¶ added in v1.9.0
func NewDashboardSettingsStore(db dbinterface.Querier) *DashboardSettingsStore
func (*DashboardSettingsStore) GetByUserID ¶ added in v1.9.0
func (s *DashboardSettingsStore) GetByUserID(ctx context.Context, userID int) (*DashboardSettings, error)
GetByUserID returns settings for a user, creating defaults if none exist
func (*DashboardSettingsStore) Update ¶ added in v1.9.0
func (s *DashboardSettingsStore) Update(ctx context.Context, userID int, input *DashboardSettingsInput) (*DashboardSettings, error)
Update updates settings for a user (partial update - merges with existing)
type ExternalProgram ¶ added in v1.7.0
type ExternalProgram struct {
ID int `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
ArgsTemplate string `json:"args_template"`
Enabled bool `json:"enabled"`
UseTerminal bool `json:"use_terminal"`
PathMappings []PathMapping `json:"path_mappings"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ExternalProgram represents a configured external program that can be executed from the torrent context menu
type ExternalProgramCreate ¶ added in v1.7.0
type ExternalProgramCreate struct {
Name string `json:"name"`
Path string `json:"path"`
ArgsTemplate string `json:"args_template"`
Enabled bool `json:"enabled"`
UseTerminal bool `json:"use_terminal"`
PathMappings []PathMapping `json:"path_mappings"`
}
ExternalProgramCreate represents the data needed to create a new external program
type ExternalProgramExecute ¶ added in v1.7.0
type ExternalProgramExecute struct {
ProgramID int `json:"program_id"`
InstanceID int `json:"instance_id"`
Hashes []string `json:"hashes"`
}
ExternalProgramExecute represents a request to execute an external program with torrent data
type ExternalProgramStore ¶ added in v1.7.0
type ExternalProgramStore struct {
// contains filtered or unexported fields
}
func NewExternalProgramStore ¶ added in v1.7.0
func NewExternalProgramStore(db dbinterface.Querier) *ExternalProgramStore
func (*ExternalProgramStore) Create ¶ added in v1.7.0
func (s *ExternalProgramStore) Create(ctx context.Context, create *ExternalProgramCreate) (*ExternalProgram, error)
func (*ExternalProgramStore) Delete ¶ added in v1.7.0
func (s *ExternalProgramStore) Delete(ctx context.Context, id int) error
func (*ExternalProgramStore) GetByID ¶ added in v1.7.0
func (s *ExternalProgramStore) GetByID(ctx context.Context, id int) (*ExternalProgram, error)
func (*ExternalProgramStore) List ¶ added in v1.7.0
func (s *ExternalProgramStore) List(ctx context.Context) ([]*ExternalProgram, error)
func (*ExternalProgramStore) ListEnabled ¶ added in v1.7.0
func (s *ExternalProgramStore) ListEnabled(ctx context.Context) ([]*ExternalProgram, error)
func (*ExternalProgramStore) Update ¶ added in v1.7.0
func (s *ExternalProgramStore) Update(ctx context.Context, id int, update *ExternalProgramUpdate) (*ExternalProgram, error)
type ExternalProgramUpdate ¶ added in v1.7.0
type ExternalProgramUpdate struct {
Name string `json:"name"`
Path string `json:"path"`
ArgsTemplate string `json:"args_template"`
Enabled bool `json:"enabled"`
UseTerminal bool `json:"use_terminal"`
PathMappings []PathMapping `json:"path_mappings"`
}
ExternalProgramUpdate represents the data needed to update an external program
type Instance ¶
type Instance struct {
ID int `json:"id"`
Name string `json:"name"`
Host string `json:"host"`
Username string `json:"username"`
PasswordEncrypted string `json:"-"`
BasicUsername *string `json:"basic_username,omitempty"`
BasicPasswordEncrypted *string `json:"-"`
TLSSkipVerify bool `json:"tlsSkipVerify"`
SortOrder int `json:"sortOrder"`
IsActive bool `json:"isActive"`
}
func (Instance) MarshalJSON ¶ added in v1.0.0
func (*Instance) UnmarshalJSON ¶ added in v1.0.0
type InstanceError ¶ added in v1.0.0
type InstanceErrorStore ¶ added in v1.0.0
type InstanceErrorStore struct {
// contains filtered or unexported fields
}
func NewInstanceErrorStore ¶ added in v1.0.0
func NewInstanceErrorStore(db dbinterface.Querier) *InstanceErrorStore
func (*InstanceErrorStore) ClearErrors ¶ added in v1.0.0
func (s *InstanceErrorStore) ClearErrors(ctx context.Context, instanceID int) error
ClearErrors removes all errors for an instance (called on successful connection)
func (*InstanceErrorStore) GetRecentErrors ¶ added in v1.0.0
func (s *InstanceErrorStore) GetRecentErrors(ctx context.Context, instanceID int, limit int) ([]InstanceError, error)
GetRecentErrors retrieves the last N errors for an instance
func (*InstanceErrorStore) RecordError ¶ added in v1.0.0
RecordError stores an error for an instance with simple deduplication
type InstanceReannounceSettings ¶ added in v1.8.0
type InstanceReannounceSettings struct {
InstanceID int `json:"instanceId"`
Enabled bool `json:"enabled"`
InitialWaitSeconds int `json:"initialWaitSeconds"`
ReannounceIntervalSeconds int `json:"reannounceIntervalSeconds"`
MaxAgeSeconds int `json:"maxAgeSeconds"`
MaxRetries int `json:"maxRetries"`
Aggressive bool `json:"aggressive"`
MonitorAll bool `json:"monitorAll"`
ExcludeCategories bool `json:"excludeCategories"`
Categories []string `json:"categories"`
ExcludeTags bool `json:"excludeTags"`
Tags []string `json:"tags"`
ExcludeTrackers bool `json:"excludeTrackers"`
Trackers []string `json:"trackers"`
UpdatedAt time.Time `json:"updatedAt"`
}
InstanceReannounceSettings stores per-instance tracker reannounce configuration.
func DefaultInstanceReannounceSettings ¶ added in v1.8.0
func DefaultInstanceReannounceSettings(instanceID int) *InstanceReannounceSettings
DefaultInstanceReannounceSettings returns default values for a new instance.
type InstanceReannounceStore ¶ added in v1.8.0
type InstanceReannounceStore struct {
// contains filtered or unexported fields
}
InstanceReannounceStore manages persistence for InstanceReannounceSettings.
func NewInstanceReannounceStore ¶ added in v1.8.0
func NewInstanceReannounceStore(db dbinterface.Querier) *InstanceReannounceStore
NewInstanceReannounceStore creates a new store.
func (*InstanceReannounceStore) Get ¶ added in v1.8.0
func (s *InstanceReannounceStore) Get(ctx context.Context, instanceID int) (*InstanceReannounceSettings, error)
Get returns settings for an instance, falling back to defaults if missing.
func (*InstanceReannounceStore) List ¶ added in v1.8.0
func (s *InstanceReannounceStore) List(ctx context.Context) ([]*InstanceReannounceSettings, error)
List returns settings for all instances that have overrides. Instances without overrides are omitted.
func (*InstanceReannounceStore) Upsert ¶ added in v1.8.0
func (s *InstanceReannounceStore) Upsert(ctx context.Context, settings *InstanceReannounceSettings) (*InstanceReannounceSettings, error)
Upsert saves settings for an instance, creating or updating as needed.
type InstanceStore ¶
type InstanceStore struct {
// contains filtered or unexported fields
}
func NewInstanceStore ¶
func NewInstanceStore(db dbinterface.Querier, encryptionKey []byte) (*InstanceStore, error)
func (*InstanceStore) GetDecryptedBasicPassword ¶
func (s *InstanceStore) GetDecryptedBasicPassword(instance *Instance) (*string, error)
GetDecryptedBasicPassword returns the decrypted basic auth password for an instance
func (*InstanceStore) GetDecryptedPassword ¶
func (s *InstanceStore) GetDecryptedPassword(instance *Instance) (string, error)
GetDecryptedPassword returns the decrypted password for an instance
func (*InstanceStore) SetActiveState ¶ added in v1.8.0
func (*InstanceStore) UpdateOrder ¶ added in v1.7.0
func (s *InstanceStore) UpdateOrder(ctx context.Context, instanceIDs []int) error
type LicenseInfo ¶ added in v1.0.0
type LicenseInfo struct {
Key string `json:"key"`
ProductName string `json:"productName"`
CustomerID string `json:"customerId"`
ProductID string `json:"productId"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
Valid bool `json:"valid"`
ErrorMessage string `json:"errorMessage,omitempty"`
}
LicenseInfo contains license validation information
type PathMapping ¶ added in v1.7.0
type PathMapping struct {
From string `json:"from"` // Remote path prefix
To string `json:"to"` // Local path prefix
}
PathMapping represents a path mapping from remote to local
type ProductLicense ¶ added in v1.0.0
type ProductLicense struct {
ID int `json:"id"`
LicenseKey string `json:"licenseKey"`
ProductName string `json:"productName"`
Status string `json:"status"`
ActivatedAt time.Time `json:"activatedAt"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
LastValidated time.Time `json:"lastValidated"`
PolarCustomerID *string `json:"polarCustomerId,omitempty"`
PolarProductID *string `json:"polarProductId,omitempty"`
PolarActivationID string `json:"polarActivationId,omitempty"`
Username string `json:"username"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
ProductLicense represents a product license in the database
type TorznabBackend ¶ added in v1.8.0
type TorznabBackend string
TorznabBackend represents the backend implementation used to access a Torznab indexer.
const ( // TorznabBackendJackett routes requests through a Jackett instance. TorznabBackendJackett TorznabBackend = "jackett" // TorznabBackendProwlarr routes requests through a Prowlarr instance. TorznabBackendProwlarr TorznabBackend = "prowlarr" // TorznabBackendNative talks directly to a tracker-provided Torznab/Newznab endpoint. TorznabBackendNative TorznabBackend = "native" )
func MustTorznabBackend ¶ added in v1.8.0
func MustTorznabBackend(value string) TorznabBackend
MustTorznabBackend parses backend and panics on error (useful for defaults).
func ParseTorznabBackend ¶ added in v1.8.0
func ParseTorznabBackend(value string) (TorznabBackend, error)
ParseTorznabBackend validates and normalizes a backend string.
type TorznabIndexer ¶ added in v1.8.0
type TorznabIndexer struct {
ID int `json:"id"`
Name string `json:"name"`
BaseURL string `json:"base_url"`
IndexerID string `json:"indexer_id"` // Jackett/Prowlarr indexer ID (e.g., "aither")
Backend TorznabBackend `json:"backend"`
APIKeyEncrypted string `json:"-"`
Enabled bool `json:"enabled"`
Priority int `json:"priority"`
TimeoutSeconds int `json:"timeout_seconds"`
Capabilities []string `json:"capabilities"`
Categories []TorznabIndexerCategory `json:"categories"`
LastTestAt *time.Time `json:"last_test_at,omitempty"`
LastTestStatus string `json:"last_test_status"`
LastTestError *string `json:"last_test_error,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
TorznabIndexer represents a Torznab API indexer (Jackett, Prowlarr, etc.)
type TorznabIndexerCapability ¶ added in v1.8.0
type TorznabIndexerCapability struct {
IndexerID int `json:"indexer_id"`
CapabilityType string `json:"capability_type"`
}
TorznabIndexerCapability represents a search capability
type TorznabIndexerCategory ¶ added in v1.8.0
type TorznabIndexerCategory struct {
IndexerID int `json:"indexer_id"`
CategoryID int `json:"category_id"`
CategoryName string `json:"category_name"`
ParentCategory *int `json:"parent_category_id,omitempty"`
}
TorznabIndexerCategory represents a category supported by an indexer
type TorznabIndexerCooldown ¶ added in v1.8.0
type TorznabIndexerCooldown struct {
IndexerID int `json:"indexer_id"`
ResumeAt time.Time `json:"resume_at"`
Cooldown time.Duration `json:"cooldown"`
Reason string `json:"reason,omitempty"`
}
TorznabIndexerCooldown captures a persisted rate-limit suspension window for an indexer.
type TorznabIndexerError ¶ added in v1.8.0
type TorznabIndexerError struct {
ID int `json:"id"`
IndexerID int `json:"indexer_id"`
ErrorMessage string `json:"error_message"`
ErrorCode string `json:"error_code"`
OccurredAt time.Time `json:"occurred_at"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
ErrorCount int `json:"error_count"`
}
TorznabIndexerError represents an error that occurred with an indexer
type TorznabIndexerHealth ¶ added in v1.8.0
type TorznabIndexerHealth struct {
IndexerID int `json:"indexer_id"`
IndexerName string `json:"indexer_name"`
Enabled bool `json:"enabled"`
LastTestStatus string `json:"last_test_status"`
ErrorsLast24h int `json:"errors_last_24h"`
UnresolvedErrors int `json:"unresolved_errors"`
AvgLatencyMs *float64 `json:"avg_latency_ms,omitempty"`
SuccessRatePct *float64 `json:"success_rate_pct,omitempty"`
RequestsLast7d *int `json:"requests_last_7d,omitempty"`
LastMeasuredAt *time.Time `json:"last_measured_at,omitempty"`
}
TorznabIndexerHealth represents the health status of an indexer
type TorznabIndexerLatency ¶ added in v1.8.0
type TorznabIndexerLatency struct {
ID int `json:"id"`
IndexerID int `json:"indexer_id"`
OperationType string `json:"operation_type"`
LatencyMs int `json:"latency_ms"`
Success bool `json:"success"`
MeasuredAt time.Time `json:"measured_at"`
}
TorznabIndexerLatency represents a latency measurement
type TorznabIndexerLatencyStats ¶ added in v1.8.0
type TorznabIndexerLatencyStats struct {
IndexerID int `json:"indexer_id"`
OperationType string `json:"operation_type"`
TotalRequests int `json:"total_requests"`
SuccessfulRequests int `json:"successful_requests"`
AvgLatencyMs *float64 `json:"avg_latency_ms,omitempty"`
MinLatencyMs *int `json:"min_latency_ms,omitempty"`
MaxLatencyMs *int `json:"max_latency_ms,omitempty"`
SuccessRatePct float64 `json:"success_rate_pct"`
LastMeasuredAt time.Time `json:"last_measured_at"`
}
TorznabIndexerLatencyStats represents aggregated latency statistics
type TorznabIndexerStore ¶ added in v1.8.0
type TorznabIndexerStore struct {
// contains filtered or unexported fields
}
TorznabIndexerStore manages Torznab indexers in the database
func NewTorznabIndexerStore ¶ added in v1.8.0
func NewTorznabIndexerStore(db dbinterface.Querier, encryptionKey []byte) (*TorznabIndexerStore, error)
NewTorznabIndexerStore creates a new TorznabIndexerStore
func (*TorznabIndexerStore) CleanupOldLatency ¶ added in v1.8.0
func (s *TorznabIndexerStore) CleanupOldLatency(ctx context.Context, olderThan time.Duration) (int64, error)
CleanupOldLatency removes latency records older than the specified duration
func (*TorznabIndexerStore) Create ¶ added in v1.8.0
func (s *TorznabIndexerStore) Create(ctx context.Context, name, baseURL, apiKey string, enabled bool, priority, timeoutSeconds int) (*TorznabIndexer, error)
Create creates a new Torznab indexer
func (*TorznabIndexerStore) CreateWithIndexerID ¶ added in v1.8.0
func (s *TorznabIndexerStore) CreateWithIndexerID(ctx context.Context, name, baseURL, indexerID, apiKey string, enabled bool, priority, timeoutSeconds int, backend TorznabBackend) (*TorznabIndexer, error)
func (*TorznabIndexerStore) Delete ¶ added in v1.8.0
func (s *TorznabIndexerStore) Delete(ctx context.Context, id int) error
Delete deletes a Torznab indexer String pool cleanup is handled by the centralized CleanupUnusedStrings() function
func (*TorznabIndexerStore) DeleteRateLimitCooldown ¶ added in v1.8.0
func (s *TorznabIndexerStore) DeleteRateLimitCooldown(ctx context.Context, indexerID int) error
DeleteRateLimitCooldown removes any persisted cooldown for the provided indexer ID.
func (*TorznabIndexerStore) Get ¶ added in v1.8.0
func (s *TorznabIndexerStore) Get(ctx context.Context, id int) (*TorznabIndexer, error)
Get retrieves a Torznab indexer by ID using the view
func (*TorznabIndexerStore) GetAllHealth ¶ added in v1.8.0
func (s *TorznabIndexerStore) GetAllHealth(ctx context.Context) ([]TorznabIndexerHealth, error)
GetAllHealth retrieves health information for all indexers
func (*TorznabIndexerStore) GetCapabilities ¶ added in v1.8.0
GetCapabilities retrieves all capabilities for an indexer
func (*TorznabIndexerStore) GetCategories ¶ added in v1.8.0
func (s *TorznabIndexerStore) GetCategories(ctx context.Context, indexerID int) ([]TorznabIndexerCategory, error)
GetCategories retrieves all categories for an indexer
func (*TorznabIndexerStore) GetDecryptedAPIKey ¶ added in v1.8.0
func (s *TorznabIndexerStore) GetDecryptedAPIKey(indexer *TorznabIndexer) (string, error)
GetDecryptedAPIKey returns the decrypted API key for an indexer
func (*TorznabIndexerStore) GetHealth ¶ added in v1.8.0
func (s *TorznabIndexerStore) GetHealth(ctx context.Context, indexerID int) (*TorznabIndexerHealth, error)
GetHealth retrieves health information for an indexer
func (*TorznabIndexerStore) GetLatencyStats ¶ added in v1.8.0
func (s *TorznabIndexerStore) GetLatencyStats(ctx context.Context, indexerID int) ([]TorznabIndexerLatencyStats, error)
GetLatencyStats retrieves aggregated latency statistics for an indexer
func (*TorznabIndexerStore) GetRecentErrors ¶ added in v1.8.0
func (s *TorznabIndexerStore) GetRecentErrors(ctx context.Context, indexerID int, limit int) ([]TorznabIndexerError, error)
GetRecentErrors retrieves recent errors for an indexer
func (*TorznabIndexerStore) List ¶ added in v1.8.0
func (s *TorznabIndexerStore) List(ctx context.Context) ([]*TorznabIndexer, error)
List retrieves all Torznab indexers using the view, ordered by priority (descending) and name
func (*TorznabIndexerStore) ListEnabled ¶ added in v1.8.0
func (s *TorznabIndexerStore) ListEnabled(ctx context.Context) ([]*TorznabIndexer, error)
ListEnabled retrieves all enabled Torznab indexers using the view, ordered by priority
func (*TorznabIndexerStore) ListRateLimitCooldowns ¶ added in v1.8.0
func (s *TorznabIndexerStore) ListRateLimitCooldowns(ctx context.Context) ([]TorznabIndexerCooldown, error)
ListRateLimitCooldowns returns any persisted cooldown windows for Torznab indexers.
func (*TorznabIndexerStore) RecordError ¶ added in v1.8.0
func (s *TorznabIndexerStore) RecordError(ctx context.Context, indexerID int, errorMessage, errorCode string) error
RecordError records an error for an indexer
func (*TorznabIndexerStore) RecordLatency ¶ added in v1.8.0
func (s *TorznabIndexerStore) RecordLatency(ctx context.Context, indexerID int, operationType string, latencyMs int, success bool) error
RecordLatency records a latency measurement for an indexer
func (*TorznabIndexerStore) ResolveErrors ¶ added in v1.8.0
func (s *TorznabIndexerStore) ResolveErrors(ctx context.Context, indexerID int) error
ResolveErrors marks all unresolved errors for an indexer as resolved
func (*TorznabIndexerStore) SetCapabilities ¶ added in v1.8.0
func (s *TorznabIndexerStore) SetCapabilities(ctx context.Context, indexerID int, capabilities []string) error
SetCapabilities replaces all capabilities for an indexer
func (*TorznabIndexerStore) SetCategories ¶ added in v1.8.0
func (s *TorznabIndexerStore) SetCategories(ctx context.Context, indexerID int, categories []TorznabIndexerCategory) error
SetCategories replaces all categories for an indexer
func (*TorznabIndexerStore) Test ¶ added in v1.8.0
func (s *TorznabIndexerStore) Test(ctx context.Context, baseURL, apiKey string) error
Test tests the connection to a Torznab indexer by querying its capabilities
func (*TorznabIndexerStore) Update ¶ added in v1.8.0
func (s *TorznabIndexerStore) Update(ctx context.Context, id int, params TorznabIndexerUpdateParams) (*TorznabIndexer, error)
Update updates a Torznab indexer
func (*TorznabIndexerStore) UpdateTestStatus ¶ added in v1.8.0
func (s *TorznabIndexerStore) UpdateTestStatus(ctx context.Context, id int, status string, errorMsg *string) error
UpdateTestStatus updates the test status of an indexer
func (*TorznabIndexerStore) UpsertRateLimitCooldown ¶ added in v1.8.0
func (s *TorznabIndexerStore) UpsertRateLimitCooldown(ctx context.Context, indexerID int, resumeAt time.Time, cooldown time.Duration, reason string) error
UpsertRateLimitCooldown stores or updates the cooldown window for an indexer.
type TorznabIndexerUpdateParams ¶ added in v1.8.0
type TorznabIndexerUpdateParams struct {
Name string
BaseURL string
IndexerID *string
Backend *TorznabBackend
APIKey string
Enabled *bool
Priority *int
TimeoutSeconds *int
}
TorznabIndexerUpdateParams captures optional fields for updating an indexer.
type TorznabRecentSearch ¶ added in v1.8.0
type TorznabRecentSearch struct {
CacheKey string `json:"cacheKey"`
Scope string `json:"scope"`
Query string `json:"query"`
Categories []int `json:"categories"`
IndexerIDs []int `json:"indexerIds"`
TotalResults int `json:"totalResults"`
CachedAt time.Time `json:"cachedAt"`
LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
ExpiresAt time.Time `json:"expiresAt"`
HitCount int64 `json:"hitCount"`
}
TorznabRecentSearch captures metadata about a cached search request for UI consumption.
type TorznabSearchCacheEntry ¶ added in v1.8.0
type TorznabSearchCacheEntry struct {
ID int64
CacheKey string
Scope string
Query string
Categories []int
IndexerIDs []int
RequestFingerprint string
ResponseData []byte
TotalResults int
CachedAt time.Time
LastUsedAt time.Time
ExpiresAt time.Time
HitCount int64
}
TorznabSearchCacheEntry captures a cached Torznab search response.
type TorznabSearchCacheSettings ¶ added in v1.8.0
TorznabSearchCacheSettings tracks persisted cache configuration.
type TorznabSearchCacheStats ¶ added in v1.8.0
type TorznabSearchCacheStats struct {
Entries int64 `json:"entries"`
TotalHits int64 `json:"totalHits"`
ApproxSizeBytes int64 `json:"approxSizeBytes"`
OldestCachedAt *time.Time `json:"oldestCachedAt,omitempty"`
NewestCachedAt *time.Time `json:"newestCachedAt,omitempty"`
LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
Enabled bool `json:"enabled"`
TTLMinutes int `json:"ttlMinutes"`
}
TorznabSearchCacheStats provides aggregated cache metrics for observability.
type TorznabSearchCacheStore ¶ added in v1.8.0
type TorznabSearchCacheStore struct {
// contains filtered or unexported fields
}
TorznabSearchCacheStore persists search cache entries.
func NewTorznabSearchCacheStore ¶ added in v1.8.0
func NewTorznabSearchCacheStore(db dbinterface.Querier) *TorznabSearchCacheStore
NewTorznabSearchCacheStore constructs a new search cache store.
func (*TorznabSearchCacheStore) CleanupExpired ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) CleanupExpired(ctx context.Context) (int64, error)
CleanupExpired removes all expired cache rows.
func (*TorznabSearchCacheStore) Fetch ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) Fetch(ctx context.Context, cacheKey string) (*TorznabSearchCacheEntry, bool, error)
Fetch returns a cached search response by cache key.
func (*TorznabSearchCacheStore) FindActiveByScopeAndQuery ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) FindActiveByScopeAndQuery(ctx context.Context, scope string, query string) ([]*TorznabSearchCacheEntry, error)
FindActiveByScopeAndQuery returns matching, non-expired cache entries for a scope/query pair.
func (*TorznabSearchCacheStore) Flush ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) Flush(ctx context.Context) (int64, error)
Flush removes every cache entry.
func (*TorznabSearchCacheStore) GetSettings ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) GetSettings(ctx context.Context) (*TorznabSearchCacheSettings, error)
GetSettings returns the current cache settings (if any).
func (*TorznabSearchCacheStore) InvalidateByIndexerIDs ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) InvalidateByIndexerIDs(ctx context.Context, indexerIDs []int) (int64, error)
InvalidateByIndexerIDs removes cache entries referencing any of the provided indexers.
func (*TorznabSearchCacheStore) RebaseTTL ¶ added in v1.8.0
RebaseTTL recalculates expires_at for all cached entries using the provided TTL minutes.
func (*TorznabSearchCacheStore) RecentSearches ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) RecentSearches(ctx context.Context, scope string, limit int) ([]*TorznabRecentSearch, error)
RecentSearches returns the most recently used cached search queries.
func (*TorznabSearchCacheStore) Stats ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) Stats(ctx context.Context) (*TorznabSearchCacheStats, error)
Stats returns summary metrics for the search cache table.
func (*TorznabSearchCacheStore) Store ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) Store(ctx context.Context, entry *TorznabSearchCacheEntry) error
Store inserts or updates a cached search response.
func (*TorznabSearchCacheStore) Touch ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) Touch(ctx context.Context, id int64)
Touch updates last_used_at and hit_count for a cache entry.
func (*TorznabSearchCacheStore) UpdateSettings ¶ added in v1.8.0
func (s *TorznabSearchCacheStore) UpdateSettings(ctx context.Context, ttlMinutes int) (*TorznabSearchCacheSettings, error)
UpdateSettings persists TTL minutes and returns the updated settings.
type TorznabTorrentCacheEntry ¶ added in v1.8.0
type TorznabTorrentCacheEntry struct {
IndexerID int
CacheKey string
GUID string
DownloadURL string
InfoHash string
Title string
SizeBytes int64
TorrentData []byte
}
TorznabTorrentCacheEntry represents a cached torrent payload downloaded from an indexer.
type TorznabTorrentCacheStore ¶ added in v1.8.0
type TorznabTorrentCacheStore struct {
// contains filtered or unexported fields
}
TorznabTorrentCacheStore manages cached Torznab torrent files.
func NewTorznabTorrentCacheStore ¶ added in v1.8.0
func NewTorznabTorrentCacheStore(db dbinterface.Querier) *TorznabTorrentCacheStore
NewTorznabTorrentCacheStore constructs a new cache store.
func (*TorznabTorrentCacheStore) Cleanup ¶ added in v1.8.0
func (s *TorznabTorrentCacheStore) Cleanup(ctx context.Context, olderThan time.Duration) (int64, error)
Cleanup removes entries older than the provided age, returning the number of deleted rows.
func (*TorznabTorrentCacheStore) Fetch ¶ added in v1.8.0
func (s *TorznabTorrentCacheStore) Fetch(ctx context.Context, indexerID int, cacheKey string, maxAge time.Duration) ([]byte, bool, error)
Fetch returns cached torrent data when available and not expired. maxAge <= 0 disables expiration checks.
func (*TorznabTorrentCacheStore) Store ¶ added in v1.8.0
func (s *TorznabTorrentCacheStore) Store(ctx context.Context, entry *TorznabTorrentCacheEntry) error
Store inserts or updates a cached torrent payload.
type TrackerCustomization ¶ added in v1.9.0
type TrackerCustomizationStore ¶ added in v1.9.0
type TrackerCustomizationStore struct {
// contains filtered or unexported fields
}
func NewTrackerCustomizationStore ¶ added in v1.9.0
func NewTrackerCustomizationStore(db dbinterface.Querier) *TrackerCustomizationStore
func (*TrackerCustomizationStore) Create ¶ added in v1.9.0
func (s *TrackerCustomizationStore) Create(ctx context.Context, c *TrackerCustomization) (*TrackerCustomization, error)
func (*TrackerCustomizationStore) Delete ¶ added in v1.9.0
func (s *TrackerCustomizationStore) Delete(ctx context.Context, id int) error
func (*TrackerCustomizationStore) Get ¶ added in v1.9.0
func (s *TrackerCustomizationStore) Get(ctx context.Context, id int) (*TrackerCustomization, error)
func (*TrackerCustomizationStore) List ¶ added in v1.9.0
func (s *TrackerCustomizationStore) List(ctx context.Context) ([]*TrackerCustomization, error)
func (*TrackerCustomizationStore) Update ¶ added in v1.9.0
func (s *TrackerCustomizationStore) Update(ctx context.Context, c *TrackerCustomization) (*TrackerCustomization, error)
type TrackerRule ¶ added in v1.8.0
type TrackerRule struct {
ID int `json:"id"`
InstanceID int `json:"instanceId"`
Name string `json:"name"`
TrackerPattern string `json:"trackerPattern"`
TrackerDomains []string `json:"trackerDomains,omitempty"`
Category *string `json:"category,omitempty"`
Tag *string `json:"tag,omitempty"`
UploadLimitKiB *int64 `json:"uploadLimitKiB,omitempty"`
DownloadLimitKiB *int64 `json:"downloadLimitKiB,omitempty"`
RatioLimit *float64 `json:"ratioLimit,omitempty"`
SeedingTimeLimitMinutes *int64 `json:"seedingTimeLimitMinutes,omitempty"`
Enabled bool `json:"enabled"`
SortOrder int `json:"sortOrder"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type TrackerRuleStore ¶ added in v1.8.0
type TrackerRuleStore struct {
// contains filtered or unexported fields
}
func NewTrackerRuleStore ¶ added in v1.8.0
func NewTrackerRuleStore(db dbinterface.Querier) *TrackerRuleStore
func (*TrackerRuleStore) Create ¶ added in v1.8.0
func (s *TrackerRuleStore) Create(ctx context.Context, rule *TrackerRule) (*TrackerRule, error)
func (*TrackerRuleStore) Get ¶ added in v1.8.0
func (s *TrackerRuleStore) Get(ctx context.Context, id int) (*TrackerRule, error)
func (*TrackerRuleStore) ListByInstance ¶ added in v1.8.0
func (s *TrackerRuleStore) ListByInstance(ctx context.Context, instanceID int) ([]*TrackerRule, error)
func (*TrackerRuleStore) Update ¶ added in v1.8.0
func (s *TrackerRuleStore) Update(ctx context.Context, rule *TrackerRule) (*TrackerRule, error)
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
func NewUserStore ¶
func NewUserStore(db dbinterface.Querier) *UserStore