Documentation
¶
Index ¶
- type Cycle
- type DBTX
- type GetCycleByDateParams
- type GetCyclesByDateRangeCursorParams
- type GetCyclesByDateRangeParams
- type GetSleepsByDateRangeCursorParams
- type GetSleepsByDateRangeParams
- type GetWorkoutsByDateRangeCursorParams
- type GetWorkoutsByDateRangeParams
- type Querier
- type Queries
- func (q *Queries) DeleteCycle(ctx context.Context, id int64) error
- func (q *Queries) DeleteRecovery(ctx context.Context, cycleID int64) error
- func (q *Queries) DeleteSleep(ctx context.Context, id string) error
- func (q *Queries) DeleteTokenMetadata(ctx context.Context) error
- func (q *Queries) DeleteWorkout(ctx context.Context, id string) error
- func (q *Queries) GetCycle(ctx context.Context, id int64) (Cycle, error)
- func (q *Queries) GetCycleByDate(ctx context.Context, arg GetCycleByDateParams) (Cycle, error)
- func (q *Queries) GetCyclesByDateRange(ctx context.Context, arg GetCyclesByDateRangeParams) ([]Cycle, error)
- func (q *Queries) GetCyclesByDateRangeCursor(ctx context.Context, arg GetCyclesByDateRangeCursorParams) ([]Cycle, error)
- func (q *Queries) GetLastNotificationPoll(ctx context.Context) (*time.Time, error)
- func (q *Queries) GetLatestCycles(ctx context.Context, limit int64) ([]Cycle, error)
- func (q *Queries) GetNapsByCycleID(ctx context.Context, cycleID int64) ([]Sleep, error)
- func (q *Queries) GetPendingCycles(ctx context.Context) ([]Cycle, error)
- func (q *Queries) GetRecoveriesByCycleIDs(ctx context.Context, cycleIds []int64) ([]Recovery, error)
- func (q *Queries) GetRecovery(ctx context.Context, cycleID int64) (Recovery, error)
- func (q *Queries) GetSleep(ctx context.Context, id string) (Sleep, error)
- func (q *Queries) GetSleepByCycleID(ctx context.Context, cycleID int64) (Sleep, error)
- func (q *Queries) GetSleepsByDateRange(ctx context.Context, arg GetSleepsByDateRangeParams) ([]Sleep, error)
- func (q *Queries) GetSleepsByDateRangeCursor(ctx context.Context, arg GetSleepsByDateRangeCursorParams) ([]Sleep, error)
- func (q *Queries) GetSyncState(ctx context.Context) (SyncState, error)
- func (q *Queries) GetTokenMetadata(ctx context.Context) (Token, error)
- func (q *Queries) GetWorkout(ctx context.Context, id string) (Workout, error)
- func (q *Queries) GetWorkoutsByCycleID(ctx context.Context, cycleID int64) ([]Workout, error)
- func (q *Queries) GetWorkoutsByDateRange(ctx context.Context, arg GetWorkoutsByDateRangeParams) ([]Workout, error)
- func (q *Queries) GetWorkoutsByDateRangeCursor(ctx context.Context, arg GetWorkoutsByDateRangeCursorParams) ([]Workout, error)
- func (q *Queries) MarkBackfillComplete(ctx context.Context) error
- func (q *Queries) UpdateBackfillWatermark(ctx context.Context, backfillWatermark *time.Time) error
- func (q *Queries) UpdateLastFullSync(ctx context.Context, lastFullSync *time.Time) error
- func (q *Queries) UpdateLastNotificationPoll(ctx context.Context, lastNotificationPoll *time.Time) error
- func (q *Queries) UpsertCycle(ctx context.Context, arg UpsertCycleParams) error
- func (q *Queries) UpsertRecovery(ctx context.Context, arg UpsertRecoveryParams) error
- func (q *Queries) UpsertSleep(ctx context.Context, arg UpsertSleepParams) error
- func (q *Queries) UpsertSyncState(ctx context.Context, arg UpsertSyncStateParams) error
- func (q *Queries) UpsertTokenMetadata(ctx context.Context, arg UpsertTokenMetadataParams) error
- func (q *Queries) UpsertWorkout(ctx context.Context, arg UpsertWorkoutParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Recovery
- type Sleep
- type SyncState
- type Token
- type UpsertCycleParams
- type UpsertRecoveryParams
- type UpsertSleepParams
- type UpsertSyncStateParams
- type UpsertTokenMetadataParams
- type UpsertWorkoutParams
- type Workout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cycle ¶
type Cycle struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Start time.Time `json:"start"`
End *time.Time `json:"end"`
TimezoneOffset string `json:"timezone_offset"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
FetchedAt time.Time `json:"fetched_at"`
}
type GetCycleByDateParams ¶
type Querier ¶
type Querier interface {
DeleteCycle(ctx context.Context, id int64) error
DeleteRecovery(ctx context.Context, cycleID int64) error
DeleteSleep(ctx context.Context, id string) error
DeleteTokenMetadata(ctx context.Context) error
DeleteWorkout(ctx context.Context, id string) error
GetCycle(ctx context.Context, id int64) (Cycle, error)
GetCycleByDate(ctx context.Context, arg GetCycleByDateParams) (Cycle, error)
GetCyclesByDateRange(ctx context.Context, arg GetCyclesByDateRangeParams) ([]Cycle, error)
GetCyclesByDateRangeCursor(ctx context.Context, arg GetCyclesByDateRangeCursorParams) ([]Cycle, error)
GetLastNotificationPoll(ctx context.Context) (*time.Time, error)
GetLatestCycles(ctx context.Context, limit int64) ([]Cycle, error)
GetNapsByCycleID(ctx context.Context, cycleID int64) ([]Sleep, error)
GetPendingCycles(ctx context.Context) ([]Cycle, error)
GetRecoveriesByCycleIDs(ctx context.Context, cycleIds []int64) ([]Recovery, error)
GetRecovery(ctx context.Context, cycleID int64) (Recovery, error)
GetSleep(ctx context.Context, id string) (Sleep, error)
GetSleepByCycleID(ctx context.Context, cycleID int64) (Sleep, error)
GetSleepsByDateRange(ctx context.Context, arg GetSleepsByDateRangeParams) ([]Sleep, error)
GetSleepsByDateRangeCursor(ctx context.Context, arg GetSleepsByDateRangeCursorParams) ([]Sleep, error)
GetSyncState(ctx context.Context) (SyncState, error)
GetTokenMetadata(ctx context.Context) (Token, error)
GetWorkout(ctx context.Context, id string) (Workout, error)
GetWorkoutsByCycleID(ctx context.Context, cycleID int64) ([]Workout, error)
GetWorkoutsByDateRange(ctx context.Context, arg GetWorkoutsByDateRangeParams) ([]Workout, error)
GetWorkoutsByDateRangeCursor(ctx context.Context, arg GetWorkoutsByDateRangeCursorParams) ([]Workout, error)
MarkBackfillComplete(ctx context.Context) error
UpdateBackfillWatermark(ctx context.Context, backfillWatermark *time.Time) error
UpdateLastFullSync(ctx context.Context, lastFullSync *time.Time) error
UpdateLastNotificationPoll(ctx context.Context, lastNotificationPoll *time.Time) error
UpsertCycle(ctx context.Context, arg UpsertCycleParams) error
UpsertRecovery(ctx context.Context, arg UpsertRecoveryParams) error
UpsertSleep(ctx context.Context, arg UpsertSleepParams) error
UpsertSyncState(ctx context.Context, arg UpsertSyncStateParams) error
UpsertTokenMetadata(ctx context.Context, arg UpsertTokenMetadataParams) error
UpsertWorkout(ctx context.Context, arg UpsertWorkoutParams) error
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteRecovery ¶
func (*Queries) DeleteTokenMetadata ¶
func (*Queries) DeleteWorkout ¶
func (*Queries) GetCycleByDate ¶
func (*Queries) GetCyclesByDateRange ¶
func (*Queries) GetCyclesByDateRangeCursor ¶
func (*Queries) GetLastNotificationPoll ¶
func (*Queries) GetLatestCycles ¶
func (*Queries) GetNapsByCycleID ¶
func (*Queries) GetPendingCycles ¶
func (*Queries) GetRecoveriesByCycleIDs ¶
func (*Queries) GetRecovery ¶
func (*Queries) GetSleepByCycleID ¶
func (*Queries) GetSleepsByDateRange ¶
func (*Queries) GetSleepsByDateRangeCursor ¶
func (*Queries) GetSyncState ¶
func (*Queries) GetTokenMetadata ¶
func (*Queries) GetWorkout ¶
func (*Queries) GetWorkoutsByCycleID ¶
func (*Queries) GetWorkoutsByDateRange ¶
func (*Queries) GetWorkoutsByDateRangeCursor ¶
func (*Queries) MarkBackfillComplete ¶
func (*Queries) UpdateBackfillWatermark ¶
func (*Queries) UpdateLastFullSync ¶
func (*Queries) UpdateLastNotificationPoll ¶
func (*Queries) UpsertCycle ¶
func (q *Queries) UpsertCycle(ctx context.Context, arg UpsertCycleParams) error
func (*Queries) UpsertRecovery ¶
func (q *Queries) UpsertRecovery(ctx context.Context, arg UpsertRecoveryParams) error
func (*Queries) UpsertSleep ¶
func (q *Queries) UpsertSleep(ctx context.Context, arg UpsertSleepParams) error
func (*Queries) UpsertSyncState ¶
func (q *Queries) UpsertSyncState(ctx context.Context, arg UpsertSyncStateParams) error
func (*Queries) UpsertTokenMetadata ¶
func (q *Queries) UpsertTokenMetadata(ctx context.Context, arg UpsertTokenMetadataParams) error
func (*Queries) UpsertWorkout ¶
func (q *Queries) UpsertWorkout(ctx context.Context, arg UpsertWorkoutParams) error
type Recovery ¶
type Recovery struct {
CycleID int64 `json:"cycle_id"`
SleepID string `json:"sleep_id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
FetchedAt time.Time `json:"fetched_at"`
}
type Sleep ¶
type Sleep struct {
ID string `json:"id"`
CycleID int64 `json:"cycle_id"`
V1ID *int64 `json:"v1_id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
TimezoneOffset string `json:"timezone_offset"`
Nap int64 `json:"nap"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
FetchedAt time.Time `json:"fetched_at"`
}
type SyncState ¶
type SyncState struct {
ID int64 `json:"id"`
BackfillComplete int64 `json:"backfill_complete"`
BackfillWatermark *time.Time `json:"backfill_watermark"`
LastFullSync *time.Time `json:"last_full_sync"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
LastNotificationPoll *time.Time `json:"last_notification_poll"`
}
type UpsertCycleParams ¶
type UpsertCycleParams struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Start time.Time `json:"start"`
End *time.Time `json:"end"`
TimezoneOffset string `json:"timezone_offset"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
}
type UpsertRecoveryParams ¶
type UpsertSleepParams ¶
type UpsertSleepParams struct {
ID string `json:"id"`
CycleID int64 `json:"cycle_id"`
V1ID *int64 `json:"v1_id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
TimezoneOffset string `json:"timezone_offset"`
Nap int64 `json:"nap"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
}
type UpsertSyncStateParams ¶
type UpsertWorkoutParams ¶
type UpsertWorkoutParams struct {
ID string `json:"id"`
V1ID *int64 `json:"v1_id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
TimezoneOffset string `json:"timezone_offset"`
SportName string `json:"sport_name"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
}
type Workout ¶
type Workout struct {
ID string `json:"id"`
V1ID *int64 `json:"v1_id"`
UserID int64 `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
TimezoneOffset string `json:"timezone_offset"`
SportName string `json:"sport_name"`
ScoreState string `json:"score_state"`
ScoreJson *string `json:"score_json"`
FetchedAt time.Time `json:"fetched_at"`
}
Click to show internal directories.
Click to hide internal directories.