mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
feat: implement data retention mechanism
This commit is contained in:
@@ -42,6 +42,7 @@ type IHeartbeatService interface {
|
||||
GetEntitySetByUser(uint8, *models.User) ([]string, error)
|
||||
DeleteBefore(time.Time) error
|
||||
DeleteByUser(*models.User) error
|
||||
DeleteByUserBefore(*models.User, time.Time) error
|
||||
}
|
||||
|
||||
type IDiagnosticsService interface {
|
||||
@@ -89,6 +90,7 @@ type ISummaryService interface {
|
||||
Summarize(time.Time, time.Time, *models.User, *models.Filters) (*models.Summary, error)
|
||||
GetLatestByUser() ([]*models.TimeByUser, error)
|
||||
DeleteByUser(string) error
|
||||
DeleteByUserBefore(string, time.Time) error
|
||||
Insert(*models.Summary) error
|
||||
}
|
||||
|
||||
@@ -97,6 +99,11 @@ type IReportService interface {
|
||||
SendReport(*models.User, time.Duration) error
|
||||
}
|
||||
|
||||
type IHousekeepingService interface {
|
||||
Schedule()
|
||||
ClearOldUserData(*models.User, time.Duration) error
|
||||
}
|
||||
|
||||
type ILeaderboardService interface {
|
||||
Schedule()
|
||||
ComputeLeaderboard([]*models.User, *models.IntervalKey, []uint8) error
|
||||
|
||||
Reference in New Issue
Block a user