Documentation ¶
Index ¶
- func CalculateRKDifference(rkActivities dm.ActivitySet, stvActivities dm.ActivitySet) *dm.ActivitySet
- type DbSync
- func (db DbSync) CountActiveUsers() (int, error)
- func (db DbSync) CreateTableIfNotExist() error
- func (db DbSync) FindSyncTaskByToken(token string) (*SyncTask, error)
- func (db DbSync) RetrieveAllSyncTasks() ([]SyncTask, error)
- func (db DbSync) StoreSyncTask(sync SyncTask) (int64, int64, SyncTask, error)
- func (db DbSync) UpdateSyncTask(sync SyncTask) (int, error)
- type DbSyncInt
- type SyncTask
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateRKDifference ¶
func CalculateRKDifference(rkActivities dm.ActivitySet, stvActivities dm.ActivitySet) *dm.ActivitySet
* Returns the set of activities that are in RunKeeper, but not in Strava. * So if the set of Runkeeper activites is A, and the set of Strava activities is B, * this function calculates B\A.
Types ¶
type DbSync ¶
type DbSync struct {
ConnectionString string
}
func (DbSync) CountActiveUsers ¶
func (DbSync) CreateTableIfNotExist ¶
func (DbSync) FindSyncTaskByToken ¶
func (DbSync) RetrieveAllSyncTasks ¶
func (DbSync) StoreSyncTask ¶
* Returns 1) Created Id, 2) Rows changed/added, 3)synctask, 4) error
type DbSyncInt ¶
type DbSyncInt interface { UpdateSyncTask(sync SyncTask) (int, error) StoreSyncTask(sync SyncTask) (int64, int64, SyncTask, error) RetrieveAllSyncTasks() ([]SyncTask, error) FindSyncTaskByToken(token string) (*SyncTask, error) CreateTableIfNotExist() error CountActiveUsers() (int, error) }
func CreateSyncDbRepo ¶
type SyncTask ¶
type SyncTask struct { StravaToken string `json:"stv_token"` StravaRefreshToken string `json:"stv_refresh_token"` RunkeeperToken string `json:"rk_token"` RunkeeperRefreshToken string `json:"rk_refresh_token"` LastSeenTimestamp int `json:"last_seen_ts"` Uid int64 `json:"id"` Environment string `json:"environment"` }
func CreateSyncTask ¶
func (SyncTask) Sync ¶
func (st SyncTask) Sync(stvClient stv.StravaClientInt, rkClient rk.RunkeeperCientInt, txn newrelic.Transaction) (int, int, error)
* return the Total difference and the number of Activites created
Click to show internal directories.
Click to hide internal directories.