with garth

This commit is contained in:
2025-08-28 09:58:24 -07:00
parent dc5bfcb281
commit 73258c0b41
31 changed files with 983 additions and 738 deletions

View File

@@ -7,7 +7,6 @@ import (
"os"
"github.com/sstent/go-garminconnect/internal/auth"
"github.com/sstent/go-garminconnect/internal/api"
)
func main() {
@@ -23,20 +22,12 @@ func main() {
authClient := auth.NewAuthClient()
// Authenticate with credentials
token, err := authClient.Authenticate(context.Background(), username, password, "")
_, err := authClient.Authenticate(context.Background(), username, password, "")
if err != nil {
fmt.Printf("Authentication failed: %v\n", err)
os.Exit(1)
}
// API client not currently used in this simple server
// It's created here for demonstration purposes only
_, err = api.NewClient(token.AccessToken)
if err != nil {
fmt.Printf("Failed to create API client: %v\n", err)
os.Exit(1)
}
// Create HTTP server
http.HandleFunc("/", homeHandler)
http.HandleFunc("/health", healthHandler)