style: move services into separated file

This commit is contained in:
2026-02-15 17:25:55 +01:00
parent af20e29064
commit 9cdaf9851c
2 changed files with 17 additions and 15 deletions

View File

@@ -11,21 +11,6 @@ const (
DEFAULT_DOWNLOAD_OUTPUT_FOLDER = "." DEFAULT_DOWNLOAD_OUTPUT_FOLDER = "."
) )
type AvailableServices int
const (
AvailableServicesTidal = iota
)
func ParseAvailableServices(service string) (AvailableServices, error) {
switch service {
case "tidal":
return AvailableServicesTidal, nil
break
}
return AvailableServicesTidal, errors.New("Invalid service.")
}
type DownloadRequest struct { type DownloadRequest struct {
Service AvailableServices Service AvailableServices
} }

View File

@@ -1 +1,18 @@
package lib package lib
import "errors"
type AvailableServices int
const (
AvailableServicesTidal = iota
)
func ParseAvailableServices(service string) (AvailableServices, error) {
switch service {
case "tidal":
return AvailableServicesTidal, nil
}
return AvailableServicesTidal, errors.New("Invalid service.")
}