Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Sports = []Sport{"Baseball", "Basketball", "Cricket", "Field Hockey", "Football", "Ice Hockey", "Kickball", "Lacrosse", "Pickle Ball", "Rugby", "Soccer", "Softball", "Table Tennis", "Tennis", "Ultimate Frisbee", "Volleyball", "Water Polo"}
Sports supported sports
Functions ¶
func NullTimeNow ¶
NullTimeNow returns time.Now() as a nullable database value
Types ¶
type Base ¶
type Base struct { Model `json:"-"` ID int64 `json:"id,omitempty"` Created null.Time `sql:" NOT NULL DEFAULT now()" json:"created,omitempty"` CreatedBy int64 `sql:" NOT NULL DEFAULT 0" json:"createdby,omitempty"` Modified null.Time `json:"modified,omitempty"` ModifiedBy int64 `sql:" NOT NULL DEFAULT 0" json:"modifiedby,omitempty"` }
Base model that provides common fields
type Game ¶
type Game struct { Base Sport Sport `json:"sport"` HomeTeam Team `json:"hometeam"` AwayTeam Team `json:"awayteam"` HomeScore int `json:"homescore"` AwayScore int `json:"awayscore"` Start null.Time `json:"start,omitempty"` Final bool `json:"final"` Venue Venue `json:"venue,omitempty"` Notes pq.Int64Array `json:"-"` NoteCount int `sql:"-" json:"notecount"` }
Game data model
func SelectGames ¶
SelectGames from data store where ID in slice
type Member ¶
type Member struct { Base Handle string `sql:" NOT NULL UNIQUE"` Email string `sql:" NOT NULL UNIQUE"` FirstName string `json:"firstname"` LastName string `json:"lastname"` Provider string `json:"-"` ProviderID string `json:"-"` Enabled bool `json:"-"` LastActive null.Time `json:"-"` Teams pq.Int64Array `json:"-"` TeamCount int `sql:"-" json:"teamCount"` Follows pq.Int64Array `json:"-"` FollowCount int `sql:"-" json:"followCount"` Followers pq.Int64Array `json:"-"` FollowerCount int `sql:"-" json:"followerCount"` }
Member data model
func GetMemberFromProvider ¶
GetMemberFromProvider returns a member from data store based on provider name and userID
func SearchMembers ¶
SearchMembers finds members that match a search string
func SelectMembers ¶
SelectMembers from data store where ID in slice
func (*Member) DoesFollow ¶
DoesFollow shows if Member follows id
func (*Member) HasFollower ¶
HasFollower shows if id is a follower of Member
type Team ¶
type Team struct { Base Name string `json:"name"` Sport Sport `json:"sport,omitempty"` Venue Venue `json:"venue,omitempty"` Mascot string `json:"mascot,omitempty"` Games pq.Int64Array `json:"-"` GameCount int `sql:"-" json:"gameCount"` }
Team data model
func GetTeamFull ¶
GetTeamFull returns team from data store with nested structs populated
func SearchTeams ¶
SearchTeams finds teams that match a search string and sport
func SelectTeams ¶
SelectTeams from data store where ID in slice
type Venue ¶
type Venue struct { Base Name string `json:"name,omitempty"` Address string `json:"address,omitempty"` Coordinates string `json:"coordinates,omitempty"` }
Venue data model
func SearchVenues ¶
SearchVenues finds venues that match a search string
func SelectVenues ¶
SelectVenues from data store where ID in slice