provide a way to run app

This commit is contained in:
2024-08-10 14:14:38 +03:00
parent ba6ac26bac
commit 0046755c7d
10 changed files with 468 additions and 168 deletions

View File

@ -34,18 +34,23 @@ func (r *repository) StatsRepository() statsRepository {
}
}
func (r *repository) Close() error {
r.db.Close()
return nil
}
type statsRepository struct {
db *pgxpool.Pool
}
type deviceStatsDB struct {
UpdatedAt time.Time
DeviceID string
IncomingTraffic int
OutgoingTraffic int
IncomingRPS int
ReadRPS int
WriteRPS int
UpdatedAt time.Time
}
func (s deviceStatsDB) asDomain() entities.DeviceStatistics {