internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OrganizationID int
	PastDuration   time.Duration
	FutureDuration time.Duration
}

Config holds the application configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default application configuration.

type Line

type Line struct {
	HomePlayer1 Player
	HomePlayer2 Player

	AwayPlayer1 Player
	AwayPlayer2 Player

	WinnerScore string
	WinningTeam Team
}

Line represents and individual line within a match.

type Match

type Match struct {
	Date         time.Time
	HomeTeam     *Team
	VisitingTeam *Team
	Location     *Organization

	Outcome struct {
		WinningTeam  *Team
		WinnerPoints int
		LoserPoints  int
	}

	Lines []Line
}

Match represents a match consisting of multiple lines.

func (*Match) ForOrganization

func (m *Match) ForOrganization(forOrg *Organization) (date time.Time, first string, outcome string, locator string, second string)

type Newsletter

type Newsletter struct {
	// contains filtered or unexported fields
}

func NewNewsletter

func NewNewsletter(cfg Config) (*Newsletter, error)

func (*Newsletter) Generate

func (n *Newsletter) Generate() error

func (*Newsletter) String

func (n *Newsletter) String() string

type Organization

type Organization struct {
	ID    int     `json:"id"`
	Name  string  `json:"name"`
	Teams []*Team `json:"teams"`
	// contains filtered or unexported fields
}

Organization represents a USTA NorCal organization.

func LoadOrganization

func LoadOrganization(id int) (*Organization, error)

LoadOrganization loads the organization details for the given organization ID.

func (*Organization) Equals

func (o *Organization) Equals(ao *Organization) bool

func (*Organization) LoadTeams

func (o *Organization) LoadTeams() (*Organization, error)

LoadTeams loads teams for an organization.

func (*Organization) ShortName

func (o *Organization) ShortName() string

type Player

type Player struct {
	ID         int
	USTANumber int

	FirstName string
	LastName  string
}

Player represents and invidiual player on a team.

type Team

type Team struct {
	ID           int           `json:"id"`
	Organization *Organization `json:"organization"`
	Name         string        `json:"name"`
	FriendlyName string        `json:"friendly_name`
	Matches      []Match       `json:"matches`
	Players      []Player      `json:"players"`
	// contains filtered or unexported fields
}

Team represents a USTA NorCal team.

func LoadTeam

func LoadTeam(id int) (*Team, error)

LoadTeam loads a team's information for the given team ID.

func (*Team) LoadMatches

func (t *Team) LoadMatches() (*Team, error)

LoadMatches loads the matches for a team.

func (*Team) LoadOrganization

func (t *Team) LoadOrganization() (*Team, error)

LoadOrganization loads the organization for a team.

func (*Team) ShortName

func (t *Team) ShortName() string

Jump to

Keyboard shortcuts

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