sagarin

package module
v0.0.0-...-152c148 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScrapeSagarin

func ScrapeSagarin(ctx context.Context, m PubSubMessage) error

ScrapeSagarin consumes a Pub/Sub message

Types

type HomeAdvantage

type HomeAdvantage struct {
	Timestamp  time.Time `firestore:"timestamp,serverTimestamp"`
	Rating     float64   `firestore:"home_advantage_rating"`
	Points     float64   `firestore:"home_advantage_points"`
	GoldenMean float64   `firestore:"home_advantage_golden_mean"`
	Recent     float64   `firestore:"home_advantage_recent"`
}

HomeAdvantage represents Sagarin home advantages and team scores for one scraping of the website.

type PubSubMessage

type PubSubMessage struct {
	Data []byte `json:"data"`
}

PubSubMessage is the payload of a Pub/Sub event.

type Rating

type Rating struct {
	Team       *firestore.DocumentRef `firestore:"team"`
	Rating     float64                `firestore:"rating"`
	Points     float64                `firestore:"points"`
	GoldenMean float64                `firestore:"golden_mean"`
	Recent     float64                `firestore:"recent"`
}

Rating represents a team's Sagarin ratings in firestore.

type ScrapeMessage

type ScrapeMessage struct {
	SagarinURL string `json:"url"`
}

ScrapeMessage is a representation of the expected message from Pub/Sub

type Team

type Team struct {
	OtherNames []string `firestore:"other_names"`
}

Team represents how teams are stored in Firestore

Jump to

Keyboard shortcuts

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