emdb/cmd/terminal-client/main.go

30 lines
434 B
Go
Raw Normal View History

2023-12-21 15:01:06 +01:00
package main
import (
"fmt"
"net/http"
"os"
2023-12-22 15:50:42 +01:00
"ewintr.nl/emdb/cmd/terminal-client/clients"
"ewintr.nl/emdb/cmd/terminal-client/tui"
2023-12-21 15:01:06 +01:00
)
func main() {
2023-12-22 15:50:42 +01:00
tdb, err := clients.NewTMDB(os.Getenv("TMDB_API_KEY"))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
2023-12-21 15:01:06 +01:00
2023-12-22 15:50:42 +01:00
p := tui.New(tdb)
2023-12-21 15:15:51 +01:00
if _, err := p.Run(); err != nil {
fmt.Printf("Alas, there's been an error: %v", err)
os.Exit(1)
2023-12-21 15:01:06 +01:00
}
}
type EMDBClient struct {
c *http.Client
}