loader

package
v0.0.0-...-d2b6d94 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package loader uses the functions and types from jsontypes to upload the json files to a mongodb server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFavorites

func CreateFavorites(uri string) error

CreateFavorites creates the empty 'favorites' collections to hold client choices

func DropRetrosheet

func DropRetrosheet(uri string) error

DropRetrosheet drop the retrosheet database in prep for repopulation

func LoadEjections

func LoadEjections(uri, fname string) error

LoadEjections loads the ejections.json file

func LoadGameLog

func LoadGameLog(uri string, fname string) error

LoadGameLog loads a single gamelog file gamelog files are organized by year there are many gamelog files each containing multiple games

func LoadGamesAll

func LoadGamesAll(uri, dirname string) error

LoadGamesAll : loads ALL gamelog files from the specified directory the games are consoldated into one long array and then uploaded as a single unit. This works if you have enough RAM to support a large upload gamelog files are organized by year there are many gamelog files each containing multiple games Note : as of the date of this file, there are over 200,000 games in all the gamelogs, so this function can take several seconds to execute

func LoadGamesIndividually

func LoadGamesIndividually(uri, dirname string) error

LoadGamesIndividually : loads ALL gamelog files from the specified directory it uploads to mongodb one record at a time. this is useful when the system is memory constrained. It can take longer than LoadGamesAll gamelog files are organized by year there are many gamelog files each containing multiple games Note : as of the date of this file, there are over 200,000 games in all the gamelogs, so this function can take several seconds to execute

func LoadParks

func LoadParks(uri, fname string) error

LoadParks loads the parks.json file

func LoadPersonnel

func LoadPersonnel(uri string, fname string) error

LoadPersonnel ...

func LoadPlayerTeams

func LoadPlayerTeams(uri, fname string) error

LoadPlayerTeams ...

func LoadTeams

func LoadTeams(uri, fname string) error

LoadTeams loads the teams.json file

func PopulateRetrosheet

func PopulateRetrosheet(dirname string, mongodbURI string) error

PopulateRetrosheet is used to repopulate the complete retrosheet database it drops the existing db and reloads personnel, teams and games it requires the file and directory names for the data files

Types

This section is empty.

Jump to

Keyboard shortcuts

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