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
Click to show internal directories.
Click to hide internal directories.