2023-08-25 20:44:44 +00:00
package main
import (
morningalarm "git.kapelle.org/niklas/morning-alarm/internal"
"github.com/alexflint/go-arg"
)
type args struct {
SpotifyClientID string ` arg:"--spotify-client-id,required,env:SPOTIFY_CLIENT_ID" placeholder:"SPOTIFY_CLIENT_ID" `
SpotifyClientSecret string ` arg:"--spotify-client-secret,required,env:SPOTIFY_CLIENT_SECRET" placeholder:"SPOTIFY_CLIENT_SECRET" `
2023-09-25 23:07:01 +00:00
DeviceName string ` arg:"--device-name,required,env:SPOTIFY_DEVICE_NAME" placeholder:"SPOTIFY_DEVICE_NAME" help:"Can be found later in the API" `
2023-08-25 20:44:44 +00:00
PlaylistID string ` arg:"--playlist-id,required,env:SPOTIFY_PLAYLIST_ID" help:"Just the id" placeholder:"SPOTIFY_PLAYLIST_ID" `
RedirectURL string ` arg:"--redirect-url,required,env:SPOTIFY_REDIRECT_URL" help:"Must be the same as in the Spotify developer dashboard." placeholder:"SPOTIFY_REDIRECT_URL" `
2023-08-26 00:12:30 +00:00
ListenAddr string ` arg:"--listen-addr,env:LISTEN_ADDR" help:"Address to listen on" placeholder:"LISTEN_ADDR" default:":3000" `
2023-09-05 19:01:24 +00:00
OAuthProxyURL string ` arg:"--oauth-proxy-url,env:OAUTH_PROXY_URL" help:"URL of the oauth proxy" placeholder:"OAUTH_PROXY_URL" `
OAuthProxyAPIKey string ` arg:"--oauth-proxy-api-key,env:OAUTH_PROXY_API_KEY" help:"API key for the oauth proxy" placeholder:"OAUTH_PROXY_API_KEY" `
2023-08-25 20:44:44 +00:00
}
func main ( ) {
var args args
arg . MustParse ( & args )
morningalarm . New ( morningalarm . MorningAlarmConfig {
SpotifyClientID : args . SpotifyClientID ,
SpotifyClientSecret : args . SpotifyClientSecret ,
2023-09-25 23:07:01 +00:00
DeviceName : args . DeviceName ,
2023-08-25 20:44:44 +00:00
PlaylistID : args . PlaylistID ,
RedirectURL : args . RedirectURL ,
ListenAddr : args . ListenAddr ,
2023-09-05 19:01:24 +00:00
OAuthProxyURL : args . OAuthProxyURL ,
OAuthProxyAPIKey : args . OAuthProxyAPIKey ,
2023-08-25 20:44:44 +00:00
} ) . Start ( )
}