database

package
v0.0.0-...-f32f021 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Session is the shared aws session
	Session *session.Session

	// Service is the shared dynamo db connection
	Service *dynamodb.DynamoDB
)

Functions

func FetchLatestOdds

func FetchLatestOdds(dataSource string, league string) ([]game.Line, error)

FetchLatestNflOdds returns the most recently added set of game odds

func FetchProjectionV2

func FetchProjectionV2(gameDate time.Time, source string) ([]game.Projection, error)

FetchProjection returns the projection matching the given game info and source

func Init

func Init()

Init connects the database to the globaly configured dynamo db

func PutGameOddsItem

func PutGameOddsItem(odds GameOddsItem) error

PutGameOddsItem puts a single game odds item into the game-odds table

func PutGameProjection

func PutGameProjection(p game.Projection) error

Types

type GameOddsItem

type GameOddsItem struct {
	TimeStamp time.Time   `json:"time_stamp"`
	League    string      `json:"league"`
	Odds      []game.Line `json:"odds"`
	Source    string      `json:"source"`
}

GameOddsItem is the structure expected for a single item from 'game-odds'

Jump to

Keyboard shortcuts

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