mirror of
https://github.com/sstent/go-garth.git
synced 2026-02-04 13:32:04 +00:00
porting - part7 done
This commit is contained in:
48
garth/data/sleep.go
Normal file
48
garth/data/sleep.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"garmin-connect/garth/client"
|
||||
)
|
||||
|
||||
// SleepScores represents sleep scoring data
|
||||
type SleepScores struct {
|
||||
TotalSleepSeconds int `json:"totalSleepSeconds"`
|
||||
SleepScores []struct {
|
||||
StartTimeGMT time.Time `json:"startTimeGmt"`
|
||||
EndTimeGMT time.Time `json:"endTimeGmt"`
|
||||
SleepScore int `json:"sleepScore"`
|
||||
} `json:"sleepScores"`
|
||||
SleepMovement []SleepMovement `json:"sleepMovement"`
|
||||
// Add other fields from Python implementation
|
||||
}
|
||||
|
||||
// SleepMovement represents movement during sleep
|
||||
type SleepMovement struct {
|
||||
StartGMT time.Time `json:"startGmt"`
|
||||
EndGMT time.Time `json:"endGmt"`
|
||||
ActivityLevel int `json:"activityLevel"`
|
||||
}
|
||||
|
||||
// DailySleepDTO represents daily sleep data
|
||||
type DailySleepDTO struct {
|
||||
UserProfilePK int `json:"userProfilePk"`
|
||||
CalendarDate time.Time `json:"calendarDate"`
|
||||
SleepStartTimestampGMT time.Time `json:"sleepStartTimestampGmt"`
|
||||
SleepEndTimestampGMT time.Time `json:"sleepEndTimestampGmt"`
|
||||
SleepScores SleepScores `json:"sleepScores"`
|
||||
BaseData
|
||||
}
|
||||
|
||||
// Get implements the Data interface for DailySleepDTO
|
||||
func (d *DailySleepDTO) Get(day time.Time, client *client.Client) (any, error) {
|
||||
// Implementation to be added
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// List implements the Data interface for concurrent fetching
|
||||
func (d *DailySleepDTO) List(end time.Time, days int, client *client.Client, maxWorkers int) ([]any, error) {
|
||||
// Implementation to be added
|
||||
return []any{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user