Documentation
¶
Index ¶
- func ArrHealthCheck(ctx context.Context, s *core.ServiceCore, url, apiKey string, ...) (models.ServiceHealth, int)
- func BuildQueueDeleteURL(baseURL, queueID string, opts QueueDeleteOptions) string
- func BuildQueueDeleteURLWithVersion(baseURL, apiVersion, queueID string, opts QueueDeleteOptions) string
- func BuildQueueURL(baseURL, rawQuery string) string
- func BuildQueueURLWithVersion(baseURL, apiVersion, rawQuery string) string
- func CheckArrForUpdates(ctx context.Context, service, url, apiKey string) (bool, error)
- func CheckArrForUpdatesWithVersion(ctx context.Context, service, apiVersion, url, apiKey string) (bool, error)
- func DeleteQueueItem(ctx context.Context, service, baseURL, apiKey, queueID string, ...) error
- func DeleteQueueItemWithVersion(ctx context.Context, service, apiVersion, baseURL, apiKey, queueID string, ...) error
- func ExtractMessageField(body []byte) string
- func FetchQueueBody(ctx context.Context, service, baseURL, apiKey, rawQuery string, ...) ([]byte, error)
- func FetchQueueBodyWithVersion(ctx context.Context, service, apiVersion, baseURL, apiKey, rawQuery string, ...) ([]byte, error)
- func FetchQueueRecords[T any](ctx context.Context, service, baseURL, apiKey, rawQuery string, ...) ([]T, error)
- func FetchQueueRecordsWithVersion[T any](ctx context.Context, service, apiVersion, baseURL, apiKey, rawQuery string, ...) ([]T, error)
- func GetArrSystemStatus(ctx context.Context, service, url, apiKey string, ...) (string, error)
- func GetArrSystemStatusWithVersion(ctx context.Context, service, apiVersion, url, apiKey string, ...) (string, error)
- func MakeArrRequest(ctx context.Context, method, url, apiKey string, body []byte) (*http.Response, error)
- type ErrArr
- type HealthChecker
- type HealthResponse
- type QueueDeleteOptions
- type SystemStatusResponse
- type WarningCategory
- type WarningPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrHealthCheck ¶
func ArrHealthCheck(ctx context.Context, s *core.ServiceCore, url, apiKey string, checker HealthChecker) (models.ServiceHealth, int)
ArrHealthCheck provides a common implementation of health checking for *arr services
func BuildQueueDeleteURL ¶
func BuildQueueDeleteURL(baseURL, queueID string, opts QueueDeleteOptions) string
func BuildQueueDeleteURLWithVersion ¶
func BuildQueueDeleteURLWithVersion(baseURL, apiVersion, queueID string, opts QueueDeleteOptions) string
func BuildQueueURL ¶
func CheckArrForUpdates ¶
CheckArrForUpdates provides a common implementation for checking updates using v3 API.
func CheckArrForUpdatesWithVersion ¶
func CheckArrForUpdatesWithVersion(ctx context.Context, service, apiVersion, url, apiKey string) (bool, error)
CheckArrForUpdates provides a common implementation for checking updates
func DeleteQueueItem ¶
func ExtractMessageField ¶
func FetchQueueBody ¶
func FetchQueueRecords ¶
func GetArrSystemStatus ¶
func GetArrSystemStatus( ctx context.Context, service, url, apiKey string, getVersionFromCache func(context.Context, string) string, cacheVersion func(context.Context, string, string, time.Duration) error, ) (string, error)
GetArrSystemStatus provides a common implementation for getting system status using v3 API.
func GetArrSystemStatusWithVersion ¶
func GetArrSystemStatusWithVersion( ctx context.Context, service, apiVersion, url, apiKey string, getVersionFromCache func(context.Context, string) string, cacheVersion func(context.Context, string, string, time.Duration) error, ) (string, error)
GetArrSystemStatus provides a common implementation for getting system status.
Types ¶
type ErrArr ¶
type ErrArr struct {
Service string // Service name (e.g., "radarr", "sonarr")
Op string // Operation that failed
Err error // Underlying error
HttpCode int // HTTP status code if applicable
}
Custom error type for *arr services
type HealthChecker ¶
type HealthChecker interface {
GetSystemStatus(ctx context.Context, url, apiKey string) (string, error)
CheckForUpdates(ctx context.Context, url, apiKey string) (bool, error)
GetHealthEndpoint(baseURL string) string
}
HealthChecker interface defines methods required for health checking
type HealthResponse ¶
type HealthResponse struct {
Source string `json:"source"`
Type string `json:"type"`
Message string `json:"message"`
WikiURL string `json:"wikiUrl"`
}
HealthResponse represents a common health check response structure
type QueueDeleteOptions ¶
type SystemStatusResponse ¶
type SystemStatusResponse struct {
Version string `json:"version"`
}
type WarningCategory ¶
type WarningCategory string
WarningCategory represents the category of a warning message
const ( SystemCategory WarningCategory = "System" DownloadCategory WarningCategory = "Download" IndexerCategory WarningCategory = "Indexer" MediaCategory WarningCategory = "Media" NotificationCategory WarningCategory = "Notification" ApplicationCategory WarningCategory = "Application" )
type WarningPattern ¶
type WarningPattern struct {
Pattern string
Category WarningCategory
}
WarningPattern represents a known warning pattern and its categorization