Documentation
¶
Index ¶
- type ArchinisisToken
- type ArchinisisTokenStore
- func (s *ArchinisisTokenStore) DeleteToken(ctx context.Context, userID uuid.UUID) error
- func (s *ArchinisisTokenStore) GetSportIDs(ctx context.Context) ([]string, error)
- func (s *ArchinisisTokenStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, error)
- func (s *ArchinisisTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
- type CoachtechData
- type CoachtechDataStore
- func (s *CoachtechDataStore) GetData(ctx context.Context, userID uuid.UUID, after, before *time.Time) ([]json.RawMessage, error)
- func (s *CoachtechDataStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, error)
- func (s *CoachtechDataStore) InsertCoachtechData(ctx context.Context, coachtechID int32, summaryDate time.Time, testID string, ...) error
- func (s *CoachtechDataStore) InsertCoachtechID(ctx context.Context, userID uuid.UUID, coachtechID int32) error
- type DeviceInfo
- type DeviceStatus
- type GarminData
- type GarminDataStore
- func (s *GarminDataStore) DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
- func (s *GarminDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, ...) ([]LatestDataEntry, error)
- func (s *GarminDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
- func (s *GarminDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
- func (s *GarminDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
- func (s *GarminDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
- func (s *GarminDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
- type GarminToken
- type GarminTokenStore
- func (s *GarminTokenStore) DeleteToken(ctx context.Context, userID uuid.UUID) error
- func (s *GarminTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.GarminToken, error)
- func (s *GarminTokenStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
- func (s *GarminTokenStore) GetTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
- func (s *GarminTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.GarminToken, error)
- func (s *GarminTokenStore) GetUserIDByToken(ctx context.Context, token string) (uuid.UUID, error)
- func (s *GarminTokenStore) TokenExists(ctx context.Context, token string) (bool, error)
- func (s *GarminTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
- type KlabToken
- type KlabTokenStore
- func (s *KlabTokenStore) DeleteToken(ctx context.Context, userID uuid.UUID) error
- func (s *KlabTokenStore) GetSportIDs(ctx context.Context) ([]string, error)
- func (s *KlabTokenStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, error)
- func (s *KlabTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
- type LatestDataEntry
- type OuraData
- type OuraDataStore
- func (s *OuraDataStore) DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
- func (s *OuraDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, ...) ([]LatestDataEntry, error)
- func (s *OuraDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
- func (s *OuraDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
- func (s *OuraDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
- func (s *OuraDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
- func (s *OuraDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
- type OuraToken
- type OuraTokenStore
- func (s *OuraTokenStore) DeleteToken(ctx context.Context, userID uuid.UUID) error
- func (s *OuraTokenStore) GetAccessTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
- func (s *OuraTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.OuraToken, error)
- func (s *OuraTokenStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
- func (s *OuraTokenStore) GetTokenByOuraID(ctx context.Context, ouraID string) (uuid.UUID, json.RawMessage, error)
- func (s *OuraTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.OuraToken, error)
- func (s *OuraTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
- type PolarData
- type PolarDataStore
- func (s *PolarDataStore) DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
- func (s *PolarDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, ...) ([]LatestDataEntry, error)
- func (s *PolarDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
- func (s *PolarDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
- func (s *PolarDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
- func (s *PolarDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
- func (s *PolarDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
- type PolarToken
- type PolarTokenStore
- func (s *PolarTokenStore) DeleteToken(ctx context.Context, userID uuid.UUID) error
- func (s *PolarTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.PolarToken, error)
- func (s *PolarTokenStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
- func (s *PolarTokenStore) GetTokenByPolarID(ctx context.Context, polarID string) (uuid.UUID, json.RawMessage, error)
- func (s *PolarTokenStore) GetTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
- func (s *PolarTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.PolarToken, error)
- func (s *PolarTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
- type SourceCache
- type SourceCacheStore
- type SuuntoData
- type SuuntoDataStore
- func (s *SuuntoDataStore) DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
- func (s *SuuntoDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, ...) ([]LatestDataEntry, error)
- func (s *SuuntoDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
- func (s *SuuntoDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
- func (s *SuuntoDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
- func (s *SuuntoDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
- func (s *SuuntoDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
- type SuuntoToken
- type SuuntoTokenStore
- func (s *SuuntoTokenStore) DeleteToken(ctx context.Context, userID uuid.UUID) error
- func (s *SuuntoTokenStore) GetAccessTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
- func (s *SuuntoTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.SuuntoToken, error)
- func (s *SuuntoTokenStore) GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
- func (s *SuuntoTokenStore) GetTokenByUsername(ctx context.Context, username string) (uuid.UUID, json.RawMessage, error)
- func (s *SuuntoTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.SuuntoToken, error)
- func (s *SuuntoTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
- type UTVStorage
- func (s *UTVStorage) ArchinisisToken() ArchinisisToken
- func (s *UTVStorage) Coachtech() CoachtechData
- func (s *UTVStorage) Garmin() GarminData
- func (s *UTVStorage) GarminToken() GarminToken
- func (s *UTVStorage) KlabToken() KlabToken
- func (s *UTVStorage) Oura() OuraData
- func (s *UTVStorage) OuraToken() OuraToken
- func (s *UTVStorage) Ping(ctx context.Context) error
- func (s *UTVStorage) Polar() PolarData
- func (s *UTVStorage) PolarToken() PolarToken
- func (s *UTVStorage) SourceCache() SourceCache
- func (s *UTVStorage) Suunto() SuuntoData
- func (s *UTVStorage) SuuntoToken() SuuntoToken
- func (s *UTVStorage) UserData() UserData
- type UserData
- type UserDataStore
- func (s *UserDataStore) DeleteUserData(ctx context.Context, userID uuid.UUID) error
- func (s *UserDataStore) GetUserData(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
- func (s *UserDataStore) GetUserDeviceStatus(ctx context.Context, userID uuid.UUID) (DeviceStatus, error)
- func (s *UserDataStore) GetUserIDBySportID(ctx context.Context, sportID string) (uuid.UUID, error)
- func (s *UserDataStore) UpsertUserData(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchinisisToken ¶
type ArchinisisToken interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, error)
UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
DeleteToken(ctx context.Context, userID uuid.UUID) error
GetSportIDs(ctx context.Context) ([]string, error)
}
ArchinisisToken interface
type ArchinisisTokenStore ¶
type ArchinisisTokenStore struct {
// contains filtered or unexported fields
}
func (*ArchinisisTokenStore) DeleteToken ¶
func (*ArchinisisTokenStore) GetSportIDs ¶
func (s *ArchinisisTokenStore) GetSportIDs(ctx context.Context) ([]string, error)
func (*ArchinisisTokenStore) UpsertToken ¶
func (s *ArchinisisTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
type CoachtechData ¶
type CoachtechData interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, error)
GetData(ctx context.Context, userID uuid.UUID, after, before *time.Time) ([]json.RawMessage, error)
InsertCoachtechID(ctx context.Context, userID uuid.UUID, coachtechID int32) error
InsertCoachtechData(ctx context.Context, coachtechID int32, summaryDate time.Time, testID string, data json.RawMessage) error
}
CoachtechData interface
type CoachtechDataStore ¶
type CoachtechDataStore struct {
// contains filtered or unexported fields
}
func (*CoachtechDataStore) GetData ¶
func (s *CoachtechDataStore) GetData(ctx context.Context, userID uuid.UUID, after, before *time.Time) ([]json.RawMessage, error)
func (*CoachtechDataStore) InsertCoachtechData ¶
func (s *CoachtechDataStore) InsertCoachtechData(ctx context.Context, coachtechID int32, summaryDate time.Time, testID string, data json.RawMessage) error
func (*CoachtechDataStore) InsertCoachtechID ¶
type DeviceInfo ¶
type DeviceStatus ¶
type DeviceStatus struct {
Garmin DeviceInfo `json:"garmin"`
Oura DeviceInfo `json:"oura"`
Polar DeviceInfo `json:"polar"`
Suunto DeviceInfo `json:"suunto"`
}
type GarminData ¶
type GarminData interface {
GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
GetData(ctx context.Context, userID string, summaryDate string, key *string) (json.RawMessage, error)
InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
}
GarminData interface
type GarminDataStore ¶
type GarminDataStore struct {
// contains filtered or unexported fields
}
GarminDataStore struct
func (*GarminDataStore) DeleteAllData ¶
DeleteAllData deletes Garmin data for a specific user
func (*GarminDataStore) GetAllByType ¶
func (s *GarminDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
GetAllByType
func (*GarminDataStore) GetData ¶
func (s *GarminDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
Get all data for a specific date (or filter by key)
func (*GarminDataStore) GetDates ¶
func (s *GarminDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
Get available dates from Garmin data
func (*GarminDataStore) GetLatestByType ¶
func (s *GarminDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetLatestByType
func (*GarminDataStore) GetTypes ¶
func (s *GarminDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
Get all JSON keys (types) from Garmin data for a specific date
func (*GarminDataStore) InsertData ¶
func (s *GarminDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
insertData inserts Garmin data into the database
type GarminToken ¶
type GarminToken interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
TokenExists(ctx context.Context, token string) (bool, error)
GetUserIDByToken(ctx context.Context, token string) (uuid.UUID, error)
DeleteToken(ctx context.Context, userID uuid.UUID) error
GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.GarminToken, error)
GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.GarminToken, error)
GetTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
}
GarminToken interface
type GarminTokenStore ¶
type GarminTokenStore struct {
// contains filtered or unexported fields
}
func (*GarminTokenStore) DeleteToken ¶
func (*GarminTokenStore) GetDataForUpdate ¶
func (s *GarminTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.GarminToken, error)
func (*GarminTokenStore) GetTokenJSON ¶
func (s *GarminTokenStore) GetTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
func (*GarminTokenStore) GetTokensForUpdate ¶
func (s *GarminTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.GarminToken, error)
func (*GarminTokenStore) GetUserIDByToken ¶
func (*GarminTokenStore) TokenExists ¶
func (*GarminTokenStore) UpsertToken ¶
func (s *GarminTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
type KlabToken ¶
type KlabToken interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, error)
UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
DeleteToken(ctx context.Context, userID uuid.UUID) error
GetSportIDs(ctx context.Context) ([]string, error)
}
KlabToken interface
type KlabTokenStore ¶
type KlabTokenStore struct {
// contains filtered or unexported fields
}
func (*KlabTokenStore) DeleteToken ¶
func (*KlabTokenStore) GetSportIDs ¶
func (s *KlabTokenStore) GetSportIDs(ctx context.Context) ([]string, error)
func (*KlabTokenStore) UpsertToken ¶
func (s *KlabTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
type LatestDataEntry ¶
type LatestDataEntry struct {
Device string
Date time.Time
Data json.RawMessage
}
LatestDataEntry struct to hold latest data entry
type OuraData ¶
type OuraData interface {
GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
GetData(ctx context.Context, userID string, summaryDate string, key *string) (json.RawMessage, error)
InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
}
OuraData interface
type OuraDataStore ¶
type OuraDataStore struct {
// contains filtered or unexported fields
}
OuraDataStore struct
func (*OuraDataStore) DeleteAllData ¶
DeleteAllData deletes Oura data for a specific user
func (*OuraDataStore) GetAllByType ¶
func (s *OuraDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
GetAllByType
func (*OuraDataStore) GetData ¶
func (s *OuraDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
Get all data for a specific date (or filter by key)
func (*OuraDataStore) GetDates ¶
func (s *OuraDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
Get available dates from Oura data
func (*OuraDataStore) GetLatestByType ¶
func (s *OuraDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetLatestByType
func (*OuraDataStore) GetTypes ¶
func (s *OuraDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
Get all JSON keys (types) from Oura data for a specific date
func (*OuraDataStore) InsertData ¶
func (s *OuraDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
insertData inserts Oura data into the database
type OuraToken ¶
type OuraToken interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
GetTokenByOuraID(ctx context.Context, ouraID string) (uuid.UUID, json.RawMessage, error)
DeleteToken(ctx context.Context, userID uuid.UUID) error
GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.OuraToken, error)
GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.OuraToken, error)
GetAccessTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
}
OuraToken interface
type OuraTokenStore ¶
type OuraTokenStore struct {
// contains filtered or unexported fields
}
func (*OuraTokenStore) DeleteToken ¶
func (*OuraTokenStore) GetAccessTokenJSON ¶
func (s *OuraTokenStore) GetAccessTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
func (*OuraTokenStore) GetDataForUpdate ¶
func (*OuraTokenStore) GetTokenByOuraID ¶
func (s *OuraTokenStore) GetTokenByOuraID(ctx context.Context, ouraID string) (uuid.UUID, json.RawMessage, error)
func (*OuraTokenStore) GetTokensForUpdate ¶
func (*OuraTokenStore) UpsertToken ¶
func (s *OuraTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
type PolarData ¶
type PolarData interface {
GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
GetData(ctx context.Context, userID string, summaryDate string, key *string) (json.RawMessage, error)
InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
}
PolarData interface
type PolarDataStore ¶
type PolarDataStore struct {
// contains filtered or unexported fields
}
PolarDataStore struct
func (*PolarDataStore) DeleteAllData ¶
DeleteAllData deletes Polar data for a specific user
func (*PolarDataStore) GetAllByType ¶
func (s *PolarDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
GetAllByType
func (*PolarDataStore) GetData ¶
func (s *PolarDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
Get all data for a specific date (or filter by key)
func (*PolarDataStore) GetDates ¶
func (s *PolarDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
Get available dates from Polar data
func (*PolarDataStore) GetLatestByType ¶
func (s *PolarDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetLatestByType
func (*PolarDataStore) GetTypes ¶
func (s *PolarDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
Get all JSON keys (types) from Polar data for a specific date
func (*PolarDataStore) InsertData ¶
func (s *PolarDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
insertData inserts Polar data into the database
type PolarToken ¶
type PolarToken interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
GetTokenByPolarID(ctx context.Context, polarID string) (uuid.UUID, json.RawMessage, error)
DeleteToken(ctx context.Context, userID uuid.UUID) error
GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.PolarToken, error)
GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.PolarToken, error)
GetTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
}
PolarToken interface
type PolarTokenStore ¶
type PolarTokenStore struct {
// contains filtered or unexported fields
}
func (*PolarTokenStore) DeleteToken ¶
func (*PolarTokenStore) GetDataForUpdate ¶
func (s *PolarTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.PolarToken, error)
func (*PolarTokenStore) GetTokenByPolarID ¶
func (s *PolarTokenStore) GetTokenByPolarID(ctx context.Context, polarID string) (uuid.UUID, json.RawMessage, error)
func (*PolarTokenStore) GetTokenJSON ¶
func (s *PolarTokenStore) GetTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
func (*PolarTokenStore) GetTokensForUpdate ¶
func (s *PolarTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.PolarToken, error)
func (*PolarTokenStore) UpsertToken ¶
func (s *PolarTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
type SourceCache ¶
type SourceCacheStore ¶
type SourceCacheStore struct {
// contains filtered or unexported fields
}
func (*SourceCacheStore) GetAll ¶
func (s *SourceCacheStore) GetAll(ctx context.Context) ([]utvsqlc.SourceCache, error)
func (*SourceCacheStore) GetBySource ¶
func (s *SourceCacheStore) GetBySource(ctx context.Context, source string) (json.RawMessage, error)
func (*SourceCacheStore) Upsert ¶
func (s *SourceCacheStore) Upsert(ctx context.Context, source string, data json.RawMessage) error
type SuuntoData ¶
type SuuntoData interface {
GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
GetData(ctx context.Context, userID string, summaryDate string, key *string) (json.RawMessage, error)
InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
DeleteAllData(ctx context.Context, userID uuid.UUID) (int64, error)
GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
}
SuuntoData interface
type SuuntoDataStore ¶
type SuuntoDataStore struct {
// contains filtered or unexported fields
}
SuuntoDataStore struct
func (*SuuntoDataStore) DeleteAllData ¶
DeleteAllData deletes Suunto data for a specific user
func (*SuuntoDataStore) GetAllByType ¶
func (s *SuuntoDataStore) GetAllByType(ctx context.Context, userID uuid.UUID, typ string, after, before *time.Time, limit, offset int32) ([]LatestDataEntry, error)
GetAllByType
func (*SuuntoDataStore) GetData ¶
func (s *SuuntoDataStore) GetData(ctx context.Context, userID string, Date string, key *string) (json.RawMessage, error)
Get all data for a specific date (or filter by key)
func (*SuuntoDataStore) GetDates ¶
func (s *SuuntoDataStore) GetDates(ctx context.Context, userID string, startDate *string, endDate *string) ([]string, error)
Get available dates from Suunto data
func (*SuuntoDataStore) GetLatestByType ¶
func (s *SuuntoDataStore) GetLatestByType(ctx context.Context, userID uuid.UUID, typ string, limit int32) ([]LatestDataEntry, error)
GetLatestByType
func (*SuuntoDataStore) GetTypes ¶
func (s *SuuntoDataStore) GetTypes(ctx context.Context, userID string, summaryDate string) ([]string, error)
Get all JSON keys (types) from Suunto data for a specific date
func (*SuuntoDataStore) InsertData ¶
func (s *SuuntoDataStore) InsertData(ctx context.Context, userID uuid.UUID, date time.Time, data json.RawMessage) error
insertData inserts Suunto data into the database
type SuuntoToken ¶
type SuuntoToken interface {
GetStatus(ctx context.Context, userID uuid.UUID) (bool, bool, error)
UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
GetTokenByUsername(ctx context.Context, username string) (uuid.UUID, json.RawMessage, error)
DeleteToken(ctx context.Context, userID uuid.UUID) error
GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.SuuntoToken, error)
GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.SuuntoToken, error)
GetAccessTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
}
SuuntoToken interface
type SuuntoTokenStore ¶
type SuuntoTokenStore struct {
// contains filtered or unexported fields
}
func (*SuuntoTokenStore) DeleteToken ¶
func (*SuuntoTokenStore) GetAccessTokenJSON ¶
func (s *SuuntoTokenStore) GetAccessTokenJSON(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
func (*SuuntoTokenStore) GetDataForUpdate ¶
func (s *SuuntoTokenStore) GetDataForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.SuuntoToken, error)
func (*SuuntoTokenStore) GetTokenByUsername ¶
func (s *SuuntoTokenStore) GetTokenByUsername(ctx context.Context, username string) (uuid.UUID, json.RawMessage, error)
func (*SuuntoTokenStore) GetTokensForUpdate ¶
func (s *SuuntoTokenStore) GetTokensForUpdate(ctx context.Context, cutoff time.Time) ([]utvsqlc.SuuntoToken, error)
func (*SuuntoTokenStore) UpsertToken ¶
func (s *SuuntoTokenStore) UpsertToken(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
type UTVStorage ¶
type UTVStorage struct {
// contains filtered or unexported fields
}
UTVStorage struct to hold table-specific storage
func (*UTVStorage) ArchinisisToken ¶
func (s *UTVStorage) ArchinisisToken() ArchinisisToken
func (*UTVStorage) Coachtech ¶
func (s *UTVStorage) Coachtech() CoachtechData
func (*UTVStorage) Garmin ¶
func (s *UTVStorage) Garmin() GarminData
func (*UTVStorage) GarminToken ¶
func (s *UTVStorage) GarminToken() GarminToken
func (*UTVStorage) KlabToken ¶
func (s *UTVStorage) KlabToken() KlabToken
func (*UTVStorage) Oura ¶
func (s *UTVStorage) Oura() OuraData
Methods to return each table's storage interface
func (*UTVStorage) OuraToken ¶
func (s *UTVStorage) OuraToken() OuraToken
func (*UTVStorage) Polar ¶
func (s *UTVStorage) Polar() PolarData
func (*UTVStorage) PolarToken ¶
func (s *UTVStorage) PolarToken() PolarToken
func (*UTVStorage) SourceCache ¶
func (s *UTVStorage) SourceCache() SourceCache
func (*UTVStorage) Suunto ¶
func (s *UTVStorage) Suunto() SuuntoData
func (*UTVStorage) SuuntoToken ¶
func (s *UTVStorage) SuuntoToken() SuuntoToken
func (*UTVStorage) UserData ¶
func (s *UTVStorage) UserData() UserData
type UserData ¶
type UserData interface {
GetUserData(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
UpsertUserData(ctx context.Context, userID uuid.UUID, data json.RawMessage) error
DeleteUserData(ctx context.Context, userID uuid.UUID) error
GetUserIDBySportID(ctx context.Context, sportID string) (uuid.UUID, error)
GetUserDeviceStatus(ctx context.Context, userID uuid.UUID) (DeviceStatus, error)
}
UserData interface
type UserDataStore ¶
type UserDataStore struct {
// contains filtered or unexported fields
}
func (*UserDataStore) DeleteUserData ¶
func (*UserDataStore) GetUserData ¶
func (s *UserDataStore) GetUserData(ctx context.Context, userID uuid.UUID) (json.RawMessage, error)
func (*UserDataStore) GetUserDeviceStatus ¶
func (s *UserDataStore) GetUserDeviceStatus(ctx context.Context, userID uuid.UUID) (DeviceStatus, error)
func (*UserDataStore) GetUserIDBySportID ¶
func (*UserDataStore) UpsertUserData ¶
func (s *UserDataStore) UpsertUserData(ctx context.Context, userID uuid.UUID, data json.RawMessage) error