Documentation
¶
Index ¶
- Constants
- func AddMatchToDatabase(matchID uint64)
- func AddShareCode(steamID string, shareCode string)
- func CheckIfMatchExistsAlready(matchID uint64) bool
- func DownloadDemo(url string, filepath string) error
- func GetLatestShareCode(steamID string) string
- func ScanDemosDir()
- type CSGOConfig
- type Config
- type DemoNotFoundError
- type InvalidDownloadURLError
- type ShareCode
- type SteamConfig
Constants ¶
const Dictionary = "ABCDEFGHJKLMNOPQRSTUVWXYZabcdefhijkmnopqrstuvwxyz23456789"
Dictionary is used for the share code decoding.
Variables ¶
This section is empty.
Functions ¶
func AddMatchToDatabase ¶
func AddMatchToDatabase(matchID uint64)
AddMatchToDatabase adds a match id to the database and marks it as already downloaded
func AddShareCode ¶ added in v1.1.0
AddShareCode saves a share code associated to a steam id.
func CheckIfMatchExistsAlready ¶
CheckIfMatchExistsAlready checks whether the match id is already marked as downloaded (contained) in the database.
func DownloadDemo ¶
DownloadDemo will download a demo from an url and decompress and store it in local filepath. It writes to the destination file as it downloads it, without loading the entire file into memory.
func GetLatestShareCode ¶ added in v1.1.0
GetLatestShareCode returns the latest saved share code for a steam id. steamID should be uint64. However, this method is only called using string steamids coming from the config.
func ScanDemosDir ¶
func ScanDemosDir()
ScanDemosDir scans the demos dir and adds all match ids to the database
Types ¶
type CSGOConfig ¶ added in v1.1.0
type CSGOConfig struct { HistoryAPIKey string `json:"matchHistoryAuthenticationCode"` KnownMatchCode string `json:"knownMatchCode"` SteamID string `json:"steamId"` // should be uint64 Disabled bool }
CSGOConfig holds the accounts to watch.
type Config ¶
type Config struct { DemosDir string `json:"demosDir"` Steam *SteamConfig `json:"steam"` CSGO []*CSGOConfig `json:"csgo"` }
Config holds the application configuration
func GetConfiguration ¶
func GetConfiguration() Config
GetConfiguration returns the Config information
type DemoNotFoundError ¶ added in v1.1.0
type DemoNotFoundError struct {
URL string
}
DemoNotFoundError is used when a valid matchid / demo is not found or can no longer be downloaded.
func (*DemoNotFoundError) Error ¶ added in v1.1.0
func (e *DemoNotFoundError) Error() string
type InvalidDownloadURLError ¶ added in v1.1.0
type InvalidDownloadURLError struct{}
InvalidDownloadURLError is return when the url to be download is invalid or malicious.
func (*InvalidDownloadURLError) Error ¶ added in v1.1.0
func (e *InvalidDownloadURLError) Error() string
type SteamConfig ¶ added in v1.1.0
type SteamConfig struct { SteamAPIKey string `json:"apiKey"` Username string `json:"username"` Password string `json:"password"` TwoFactorSecret string `json:"twoFactorSecret"` }
SteamConfig holds the configuration about the steam account to use for communicating with the GameCoordinator.