history

package
v0.0.0-...-f06996e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsageHistoryLocation = "data/history" // Directory which contains databases with usage history
)

Variables

This section is empty.

Functions

func AllUsageHistory

func AllUsageHistory(appID int) (history [][2]int64, err error)

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

func MakeUsageRecord(appID int, userCount int, currentTime time.Time) error

MakeUsageRecord adds a record with current numer of users for a specified application.

func OpenAppUsageDB

func OpenAppUsageDB(appID int) (*sql.DB, error)

OpenAppUsageDB opens database with usage history for a specified application and, if successful, returns a reference to it.

func RemoveAppUsageDB

func RemoveAppUsageDB(appID int) error

RemoveAppUsageDB removes database with usage history for a specified application.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL