Documentation
¶
Index ¶
- Variables
- type ConfigInstance
- type ConfigManager
- type Service
- func (s *Service) CleanupQueue(ctx context.Context) error
- func (s *Service) EnsureDownloadClientRegistration(ctx context.Context, altmountHost string, altmountPort int, urlBase string, ...) error
- func (s *Service) EnsureWebhookRegistration(ctx context.Context, altmountURL string, apiKey string) error
- func (s *Service) GetAllInstances() []*model.ConfigInstance
- func (s *Service) GetFirstAdminAPIKey(ctx context.Context) string
- func (s *Service) GetHealth(ctx context.Context) (map[string]any, error)
- func (s *Service) GetInstance(instanceType, instanceName string) *model.ConfigInstance
- func (s *Service) RegisterInstance(ctx context.Context, arrURL, apiKey string) error
- func (s *Service) StartWorker(ctx context.Context) error
- func (s *Service) StopWorker(ctx context.Context)
- func (s *Service) TestConnection(ctx context.Context, instanceType, url, apiKey string) error
- func (s *Service) TestDownloadClientRegistration(ctx context.Context, altmountHost string, altmountPort int, urlBase string, ...) (map[string]string, error)
- func (s *Service) TriggerDownloadScan(ctx context.Context, instanceType string)
- func (s *Service) TriggerFileRescan(ctx context.Context, pathForRescan string, relativePath string) error
- func (s *Service) TriggerScanForFile(ctx context.Context, filePath string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrPathMatchFailed = model.ErrPathMatchFailed ErrEpisodeAlreadySatisfied = model.ErrEpisodeAlreadySatisfied ErrInstanceNotFound = model.ErrInstanceNotFound )
Functions ¶
This section is empty.
Types ¶
type ConfigInstance ¶
type ConfigInstance = model.ConfigInstance
Re-export types for backward compatibility
type ConfigManager ¶
type ConfigManager = model.ConfigManager
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages Radarr and Sonarr instances for health monitoring and file repair
func NewService ¶
func NewService(configGetter config.ConfigGetter, configManager model.ConfigManager, userRepo *database.UserRepository, queueRepo *database.Repository) *Service
NewService creates a new arrs service for health monitoring and file repair
func (*Service) CleanupQueue ¶
CleanupQueue checks all ARR instances for importPending items with empty folders
func (*Service) EnsureDownloadClientRegistration ¶
func (s *Service) EnsureDownloadClientRegistration(ctx context.Context, altmountHost string, altmountPort int, urlBase string, apiKey string) error
EnsureDownloadClientRegistration ensures that AltMount is registered as a SABnzbd download client in all enabled ARR instances
func (*Service) EnsureWebhookRegistration ¶
func (s *Service) EnsureWebhookRegistration(ctx context.Context, altmountURL string, apiKey string) error
EnsureWebhookRegistration ensures that the AltMount webhook is registered in all enabled ARR instances
func (*Service) GetAllInstances ¶
func (s *Service) GetAllInstances() []*model.ConfigInstance
GetAllInstances returns all arrs instances from configuration
func (*Service) GetFirstAdminAPIKey ¶
GetFirstAdminAPIKey retrieves the API key of the first admin user
func (*Service) GetInstance ¶
func (s *Service) GetInstance(instanceType, instanceName string) *model.ConfigInstance
GetInstance returns a specific instance by type and name
func (*Service) RegisterInstance ¶
RegisterInstance attempts to automatically register an ARR instance
func (*Service) StartWorker ¶
StartWorker starts the queue cleanup worker
func (*Service) StopWorker ¶
StopWorker stops the queue cleanup worker
func (*Service) TestConnection ¶
TestConnection tests the connection to an arrs instance
func (*Service) TestDownloadClientRegistration ¶
func (s *Service) TestDownloadClientRegistration(ctx context.Context, altmountHost string, altmountPort int, urlBase string, apiKey string) (map[string]string, error)
TestDownloadClientRegistration tests the connection from ARR instances back to AltMount
func (*Service) TriggerDownloadScan ¶
TriggerDownloadScan triggers the "Check For Finished Downloads" task in ARR instances