Documentation ¶
Overview ¶
Package api provides the mapping of the JSON documents to GraphQL. It includes the schema and resolvers for Teams, Games Personnel and Favorites. It contains functions that map the resolvers to the query package (db.go). It includes an HTTP server implementation that exposes the GraphQL API to clients.
Index ¶
- func DBGetEjections(uri string, teamAbbr string, ejectedName string, date string) ([]jt.Ejection, error)
- func DBGetEjectionsByDate(uri string, date string) ([]jt.Ejection, error)
- func DBGetEjectionsByEjectedID(uri string, ejectedid string) ([]jt.Ejection, error)
- func DBGetEjectionsByTeamAbbr(uri string, teamabbr string) ([]jt.Ejection, error)
- func DBGetFavorites(uri string, coll string) ([]string, error)
- func DBGetGames(uri string, filter interface{}, projection interface{}) ([]jt.Game, error)
- func DBGetGamesByDate(uri string, date string) ([]jt.Game, error)
- func DBGetGamesByDateRange(uri string, start string, end string) ([]jt.Game, error)
- func DBGetGamesByPlayer(uri string, playerID string) ([]jt.Game, error)
- func DBGetGamesByTeam(uri string, team string) ([]jt.Game, error)
- func DBGetGamesByTeamAndDate(uri string, team string, date string) ([]jt.Game, error)
- func DBGetGamesByUID(uri string, uid string) ([]jt.Game, error)
- func DBGetParksAll(uri string) ([]jt.Park, error)
- func DBGetPersonsByFullName(uri string, first string, last string) ([]jt.Person, error)
- func DBGetPersonsByID(uri string, id string) ([]jt.Person, error)
- func DBGetPersonsByLastName(uri string, last string) ([]jt.Person, error)
- func DBGetPersonsByUID(uri string, uid string) ([]jt.Person, error)
- func DBGetPlayerTeams(uri string, playerID string) ([]jt.PlayerTeams, error)
- func DBGetTeamsAll(uri string) ([]jt.Team, error)
- func DBGetTeamsByAbbr(uri string, abbr string) ([]jt.Team, error)
- func DBGetTeamsByNickname(uri string, nickname string) ([]jt.Team, error)
- func DBGetTeamsByUID(uri string, uid string) ([]jt.Team, error)
- func DBInsertFavoriteGame(uri string, uid string) (string, error)
- func DBInsertFavoritePerson(uri string, uid string) (string, error)
- func DBInsertFavoriteTeam(uri string, uid string) (string, error)
- func DBRemoveFavoriteGame(uri string, uid string) (string, error)
- func DBRemoveFavoritePerson(uri string, uid string) (string, error)
- func DBRemoveFavoriteTeam(uri string, uid string) (string, error)
- func RootSchema() *graphql.Schema
- func Run(url string, mongodb string)
- type EjectedArgs
- type PlayerArgs
- type PlayerTeams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBGetEjections ¶
func DBGetEjections(uri string, teamAbbr string, ejectedName string, date string) ([]jt.Ejection, error)
DBGetEjections : returns a list of ejections by a combination of team, name and date
func DBGetEjectionsByDate ¶
DBGetEjectionsByDate ...
func DBGetEjectionsByEjectedID ¶
DBGetEjectionsByEjectedID ...
func DBGetEjectionsByTeamAbbr ¶
DBGetEjectionsByTeamAbbr ...
func DBGetFavorites ¶
DBGetFavorites : returns a list of favorites from the specified favorites collection : see the collection names above
func DBGetGames ¶
DBGetGames : returns a list of games by an arbitrary filter and projection
func DBGetGamesByDate ¶
DBGetGamesByDate : returns a list of games by the date
func DBGetGamesByDateRange ¶
func DBGetGamesByPlayer ¶
DBGetGamesByPlayer : returns a list of games a player played in, either home or visitor
func DBGetGamesByTeam ¶
DBGetGamesByTeam : returns a list of games a team played in, either home or visitor this will be a long list
func DBGetGamesByTeamAndDate ¶
DBGetGamesByTeamAndDate : returns a list of games a team played in, either home or visitor and by the date
func DBGetGamesByUID ¶
DBGetGamesByUID : returns a list of games by the (unique) UID
func DBGetParksAll ¶
DBGetParksAll : returns all parks
func DBGetPersonsByFullName ¶
DBGetPersonsByFullName : returns a list of persons by both the first and last name
func DBGetPersonsByID ¶
DBGetPersonsByID : returns persons by the ID field in the record not the _id field, but the ID field from the original data
func DBGetPersonsByLastName ¶
DBGetPersonsByLastName : returns a list of persons by the last name
func DBGetPersonsByUID ¶
DBGetPersonsByUID : returns list of persons by the UID. The UID should be unique but to keep parallel to other functions it returns a slicee
func DBGetPlayerTeams ¶
func DBGetPlayerTeams(uri string, playerID string) ([]jt.PlayerTeams, error)
DBGetPlayerTeams ...
func DBGetTeamsAll ¶
DBGetTeamsAll : returns all teams
func DBGetTeamsByAbbr ¶
DBGetTeamsByAbbr : returns a list of teams by the 'abbr' field which is unique to each team
func DBGetTeamsByNickname ¶
DBGetTeamsByNickname : returns a list of teams by the team 'nickname'
func DBGetTeamsByUID ¶
DBGetTeamsByUID : returns a team by the specified UID. There should only be one but to be parallel to the other functions it returns an array
func DBInsertFavoriteGame ¶
DBInsertFavoriteGame : inserts a game into the favorites collection
func DBInsertFavoritePerson ¶
DBInsertFavoritePerson : adds a persons UID to the list of favorite persons
func DBInsertFavoriteTeam ¶
DBInsertFavoriteTeam : adds a teams UID to the list of favorite teams
func DBRemoveFavoriteGame ¶
DBRemoveFavoriteGame : removes a game from the favorites collection
func DBRemoveFavoritePerson ¶
DBRemoveFavoritePerson : removes a persons UID from the list of favorite persons
func DBRemoveFavoriteTeam ¶
DBRemoveFavoriteTeam : removes a teams UID from the list of favorite teams
Types ¶
type PlayerTeams ¶
PlayerTeams : for conversion of Teams to *[]string