mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-07 20:18:07 +01:00
style: move services into separated file
This commit is contained in:
@@ -11,21 +11,6 @@ const (
|
||||
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 {
|
||||
Service AvailableServices
|
||||
}
|
||||
|
||||
@@ -1 +1,18 @@
|
||||
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.")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user