Documentation ¶
Index ¶
- type Score
- func (s *Score) ChangeSet(winnerID string)
- func (s *Score) IsSetFinished() (finishedSet bool)
- func (s *Score) ScorePoints(scorerID string, pointsToAdd int)
- func (s Score) String() (scoreString string)
- func (s *Score) Validate(tx *pop.Connection) (validatorErrors *validate.Errors, validationError error)
- func (s *Score) ValidateCreate(tx *pop.Connection) (validatorErrors *validate.Errors, validationError error)
- func (s *Score) ValidateUpdate(tx *pop.Connection) (validatorErrors *validate.Errors, validationError error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Score ¶
type Score struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` User1Id string `json:"user1_id" db:"user1_id"` User2Id string `json:"user2_id" db:"user2_id"` User1Points int `json:"user1_points" db:"user1_points"` User2Points int `json:"user2_points" db:"user2_points"` User1Sets int `json:"user1_sets" db:"user1_sets"` User2Sets int `json:"user2_sets" db:"user2_sets"` GoalsInBalance int `json:"goals_in_balance" db:"goals_in_balance"` }
Score represents current status of foosball match between two users.
func (*Score) IsSetFinished ¶
IsSetFinished check if current set is finished.
func (*Score) ScorePoints ¶
ScorePoints add points to submitted scorer.
func (*Score) Validate ¶
func (s *Score) Validate(tx *pop.Connection) (validatorErrors *validate.Errors, validationError error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
func (*Score) ValidateCreate ¶
func (s *Score) ValidateCreate(tx *pop.Connection) (validatorErrors *validate.Errors, validationError error)
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method.
func (*Score) ValidateUpdate ¶
func (s *Score) ValidateUpdate(tx *pop.Connection) (validatorErrors *validate.Errors, validationError error)
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method.
Click to show internal directories.
Click to hide internal directories.