utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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 CheckIfMatchExistsAlready

func CheckIfMatchExistsAlready(matchID uint64) bool

CheckIfMatchExistsAlready checks whether the match id is already marked as downloaded (contained) in the database.

func DownloadDemo

func DownloadDemo(url string, filepath string) error

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 ScanDemosDir

func ScanDemosDir()

ScanDemosDir scans the demos dir and adds all match ids to the database

Types

type Config

type Config struct {
	HistoryAPIKey   string `json:"matchHistoryAuthenticationCode"`
	SteamAPIKey     string `json:"steamApiKey"`
	KnownMatchCode  string `json:"knownMatchCode"`
	SteamID         string `json:"steamId"` // should be uint64
	Username        string `json:"username"`
	Password        string `json:"password"`
	TwoFactorSecret string `json:"twoFactorSecret"`
	DemosDir        string `json:"demosDir"`
}

Config holds the application configuration

func GetConfiguration

func GetConfiguration() Config

GetConfiguration returns the Config information

type ShareCode

type ShareCode struct {
	MatchID   uint64
	OutcomeID uint64
	Token     uint32
}

ShareCode holds the decoded match code

func Decode

func Decode(code string) *ShareCode

Decode decodes the share code. Taken from ValvePython/csgo

Jump to

Keyboard shortcuts

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