Documentation ¶
Index ¶
- func GetMatchesBetween(matches *[]Match, teamA string, teamB string) (*[]Match, error)
- func GetMatchesPlayedBy(matches *[]Match, teamName string) (*[]Match, error)
- func GetMatchesPlayedByOpponents(matches *[]Match, teamName string) (*[]Match, error)
- func GetMeetingCount(matches *[]Match, teamA string, teamB string) (int, error)
- func GetOpponents(matches *[]Match, teamName string) ([]string, error)
- type Builder
- func (m *Builder) BuildAwayName(awayName string) *Builder
- func (m *Builder) BuildAwayScore(awayScore int) *Builder
- func (m *Builder) BuildDate(date time.Time) *Builder
- func (m *Builder) BuildHomeName(homeName string) *Builder
- func (m *Builder) BuildHomeScore(homeScore int) *Builder
- func (m *Builder) GetInstance() *Match
- type Factory
- type Match
- func (m *Match) Contains(teamName string) bool
- func (m *Match) GetOpponent(teamName string) (string, error)
- func (m *Match) IsAwayTeam(teamName string) bool
- func (m *Match) IsDraw() bool
- func (m *Match) IsHomeTeam(teamName string) bool
- func (m *Match) IsLoser(teamName string) bool
- func (m *Match) IsWinner(teamName string) bool
- func (m *Match) ToFullString() string
- func (m *Match) ToString() string
- func (m *Match) WinValue(teamName string) float64
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMatchesBetween ¶
GetMatchesBetween returns the matches played between two teams.
func GetMatchesPlayedBy ¶
GetMatchesPlayedBy returns the matches played by a given team.
func GetMatchesPlayedByOpponents ¶
GetMatchesPlayedByOpponents returns the matches played by the opponents of a given team. This excludes all matches played by the given team.
func GetMeetingCount ¶
GetMeetingCount returns the number of meetings between two teams.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) BuildAwayName ¶
func (*Builder) BuildAwayScore ¶
func (*Builder) BuildHomeName ¶
func (*Builder) BuildHomeScore ¶
func (*Builder) GetInstance ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a factory for creating matches.
func NewFactory ¶
NewFactory creates a new match factory.
func (*Factory) Create ¶
func (m *Factory) Create(date time.Time, homeName string, homeScore int, awayName string, awayScore int) *Match
Create creates a new match with the given parameters.
func (*Factory) CreateFromString ¶
type Match ¶
func NewMatchFromString ¶
func (*Match) IsAwayTeam ¶
func (*Match) IsHomeTeam ¶
func (*Match) ToFullString ¶
Click to show internal directories.
Click to hide internal directories.