Documentation ¶
Index ¶
- Constants
- func AllUsageHistory(appID int) (history [][2]int64, err error)
- func GetPeakBetween(start time.Time, end time.Time, appID int) (count int, time time.Time, err error)
- func HistoryCleanup() error
- func MakeUsageRecord(appID int, userCount int, currentTime time.Time) error
- func OpenAppUsageDB(appID int) (*sql.DB, error)
- func RemoveAppUsageDB(appID int) error
Constants ¶
const (
UsageHistoryLocation = "data/history" // Directory which contains databases with usage history
)
Variables ¶
This section is empty.
Functions ¶
func AllUsageHistory ¶
AllUsageHistory returns usage data for specified application as a collection of two integers. First is a time, second - number of users.
func GetPeakBetween ¶
func GetPeakBetween(start time.Time, end time.Time, appID int) (count int, time time.Time, err error)
GetPeakBetween returns peak and it's time for a specified application in between specified time period.
func HistoryCleanup ¶
func HistoryCleanup() error
HistoryCleanup removes all records with 0 value for all usable apps. This fixes an issue when Steam API sometimes returns 0 value.
func MakeUsageRecord ¶
MakeUsageRecord adds a record with current numer of users for a specified application.
func OpenAppUsageDB ¶
OpenAppUsageDB opens database with usage history for a specified application and, if successful, returns a reference to it.
func RemoveAppUsageDB ¶
RemoveAppUsageDB removes database with usage history for a specified application.
Types ¶
This section is empty.