Add initial implementation of *arr service client

- Created `client.go` for the main client structure and methods to interact with *arr services.
- Added `types.go` to define data structures for system status, movies, and series.
- Implemented `radarr.go` for Radarr-specific client methods including health checks and movie retrieval.
- Introduced `interfaces.go` to define service interfaces for common operations across *arr services.
- Established a basic `main.go` for application entry point.
- Included a tutorial markdown file to guide users through building the client and understanding Go concepts.
- Initialized `go.mod` for module management.
- Organized code into appropriate packages for better structure and maintainability.
This commit is contained in:
2025-08-21 18:52:15 -04:00
commit 6240ed0b1f
7 changed files with 3009 additions and 0 deletions

30
interfaces.go Normal file
View File

@@ -0,0 +1,30 @@
package main
// ServiceClient defines the interface all *arr services must implement
type ServiceClient interface {
GetSystemStatus() (*SystemStatus, error)
GetHealth() ([]HealthCheck, error)
}
// MovieService defines movie-specific operations (Radarr)
type MovieService interface {
ServiceClient
GetMovies() ([]Movie, error)
GetMovie(id int) (*Movie, error)
AddMovie(movie *Movie) (*Movie, error)
}
// SeriesService defines series-specific operations (Sonarr)
type SeriesService interface {
ServiceClient
GetSeries() ([]Series, error)
GetSeriesById(id int) (*Series, error)
AddSeries(series *Series) (*Series, error)
}
// HealthCheck is the struct that represents the health check result.
type HealthCheck struct {
Source string `json:"source"`
Type string `json:"type"`
Message string `json:"message"`
}