dataModel

package
v0.0.0-...-6690001 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTagLength         = 5
	MaxNameLength        = 50
	MaxDescriptionLength = 500
	MaxMdLength          = 50000
	MaxPasswordLength    = 64
	MinInformationLength = 2
	MinPasswordLength    = 8
)
View Source
const (
	NameTooLong                       = "Name too long"
	NameTooShort                      = "Name too short"
	TagTooLong                        = "Tag too long"
	GameIdentifierTooLong             = "Game identifier too long"
	GameIdentifierTooShort            = "Game identifier too short"
	TagTooShort                       = "Tag too short"
	PasswordTooLong                   = "Password too long"
	PasswordTooShort                  = "Password too short"
	DescriptionTooLong                = "Description too long"
	MarkdownTooLong                   = "Markdown too long"
	LeagueNameInUse                   = "League name already in use"
	EmailInUse                        = "Email in use"
	EmailMalformed                    = "Email is malformed"
	InvalidGame                       = "Game string not valid"
	LeaguePermissionsWrong            = "League cannot be invisible but have public join enabled"
	TimeOutOfOrder                    = "Start time before end time"
	PeriodOutOfOrder                  = "League starts before signup ends"
	AdminLackingPermissions           = "Administrator must have all permissions enabled"
	TeamsMustBeDifferent              = "The two teams in game must be different"
	TeamInGameDoesNotExist            = "A team in this game does not exist in this league"
	PlayerGameIdentifierInUse         = "Player game Identifier already in use"
	ExternalIdentifierInUse           = "An entity in this league already has this external id"
	GameConflict                      = "A team in this game already has a game starting at this time"
	GameNotDuringLeague               = "This game start time is not during the league competition period"
	AvailabilityStartNotDuringLeague  = "This availability start time is not during the league competition period"
	AvailabilityEndNotDuringLeague    = "This availability end time is not during the league competition period"
	GameDoesNotContainTeams           = "The teams in this game report are not in this game"
	AvailabilityOutOfOrder            = "Availability start time must be before end time"
	InvalidWeekday                    = "Weekday must be one of 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'"
	InvalidTimezone                   = "Timezone offset cannot be more than 24 hours"
	InvalidHour                       = "Hour must be between 0 and 23 inclusive"
	InvalidMinute                     = "Minute must be between 0 and 59 inclusive"
	InvalidWeeklyAvailabilityDuration = "Weekly availability duration can not be longer than a week"
	TournamentTypeNotSupported        = "The specified tournament type is not supported"
	AvailabilitiesNotDuringLeague     = "New league times would result in an availability outside the league competition period"
	GamesNotDuringLeague              = "New league times would result in a game scheduled outside the league competition period"
)

Variables

View Source
var ValidGameStrings = [...]string{
	"genericsport",
	"basketball",
	"curling",
	"football",
	"hockey",
	"rugby",
	"soccer",
	"volleyball",
	"waterpolo",
	"genericesport",
	"csgo",
	"leagueoflegends",
	"overwatch",
}

Functions

This section is empty.

Types

type Availability

type Availability struct {
	AvailabilityId int `json:"availabilityId"`
	StartTime      int `json:"startTime"`
	EndTime        int `json:"endTime"`
}

type AvailabilityCore

type AvailabilityCore struct {
	StartTime int `json:"startTime"`
	EndTime   int `json:"endTime"`
}

func (*AvailabilityCore) Validate

func (avail *AvailabilityCore) Validate(leagueId int, leagueDao LeagueDAO) (bool, string, error)

type CompetitionWeek

type CompetitionWeek struct {
	WeekStart int     `json:"weekStart"`
	Games     []*Game `json:"games"`
}

type DataProblem

type DataProblem string

type Game

type Game struct {
	GameId     int         `json:"gameId"`
	GameTime   int         `json:"gameTime"`
	Team1      TeamDisplay `json:"team1"`
	Team2      TeamDisplay `json:"team2"`
	WinnerId   int         `json:"winnerId"`
	LoserId    int         `json:"loserId"`
	ScoreTeam1 int         `json:"scoreTeam1"`
	ScoreTeam2 int         `json:"scoreTeam2"`
	Complete   bool        `json:"complete"`
}

type GameCore

type GameCore struct {
	GameTime int         `json:"gameTime"`
	Team1    TeamDisplay `json:"team1"`
	Team2    TeamDisplay `json:"team2"`
}

type GameCreationInformation

type GameCreationInformation struct {
	Team1Id  int `json:"team1Id"`
	Team2Id  int `json:"team2Id"`
	GameTime int `json:"gameTime"`
}

func (GameCreationInformation) Validate

func (game GameCreationInformation) Validate(leagueId int, leagueDao LeagueDAO, teamDao TeamDAO, gameDao GameDAO) (bool, string, error)

func (GameCreationInformation) ValidateReschedule

func (game GameCreationInformation) ValidateReschedule(leagueId, gameId int, leagueDao LeagueDAO, teamDao TeamDAO, gameDao GameDAO) (bool, string, error)

type GameDAO

type GameDAO interface {
	// Modify Games
	CreateGame(leagueId int, gameInformation GameCreationInformation) (int, error)
	ReportGame(gameId int, gameResult GameResult) error
	ReportGameByExternalId(externalId string, gameResult GameResult) (int, int, error)
	DeleteGame(gameId int) error
	RescheduleGame(gameId, gameTime int) error
	AddExternalId(gameId int, externalId string) error

	// Get Game Information
	GetAllGamesInLeague(leagueId int) ([]*Game, error)
	GetSortedGames(leagueId, teamId, limit int) (*SortedGames, error)
	GetGamesByWeek(leagueId, timeZone int) ([]*CompetitionWeek, error)
	GetGameInformation(gameId int) (*Game, error)
	GetGameInformationFromExternalId(externalId string) (*Game, error)
	DoesGameExistInLeague(leagueId, gameId int) (bool, error)

	// Get Information for Games Management
	DoesExistConflict(team1Id, team2Id, gameTime int) (bool, error)
	HasReportResultPermissions(leagueId, gameId, userId int) (bool, error)
}

type GameResult

type GameResult struct {
	WinnerId   int `json:"winnerId"`
	LoserId    int `json:"loserId"`
	ScoreTeam1 int `json:"scoreTeam1"`
	ScoreTeam2 int `json:"scoreTeam2"`
}

func (*GameResult) Validate

func (gameResult *GameResult) Validate(gameId int, gameDao GameDAO) (bool, string, error)

func (*GameResult) ValidateByExternalId

func (gameResult *GameResult) ValidateByExternalId(externalGameId string, gameDao GameDAO) (bool, string, error)

type GameTime

type GameTime struct {
	GameTime int `json:"gameTime"`
}

func (*GameTime) Validate

func (gameTime *GameTime) Validate(leagueId, gameId int, leagueDao LeagueDAO, teamDao TeamDAO, gameDao GameDAO) (bool, string, error)

type League

type League struct {
	LeagueId    int    `json:"leagueId"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Game        string `json:"game"`
	PublicView  bool   `json:"publicView"`
	PublicJoin  bool   `json:"publicJoin"`
	SignupStart int    `json:"signupStart"`
	SignupEnd   int    `json:"signupEnd"`
	LeagueStart int    `json:"leagueStart"`
	LeagueEnd   int    `json:"leagueEnd"`
}

type LeagueCore

type LeagueCore struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Game        string `json:"game"`
	PublicView  bool   `json:"publicView"`
	PublicJoin  bool   `json:"publicJoin"`
	SignupStart int    `json:"signupStart"`
	SignupEnd   int    `json:"signupEnd"`
	LeagueStart int    `json:"leagueStart"`
	LeagueEnd   int    `json:"leagueEnd"`
}

func (*LeagueCore) ValidateEdit

func (league *LeagueCore) ValidateEdit(leagueId int, leagueDao LeagueDAO, gameDao GameDAO) (bool, string, error)

func (*LeagueCore) ValidateNew

func (league *LeagueCore) ValidateNew(leagueDao LeagueDAO) (bool, string, error)

type LeagueDAO

type LeagueDAO interface {
	// Modify League
	CreateLeague(userId int, leagueInfo LeagueCore) (int, error)
	UpdateLeague(leagueId int, leagueInfo LeagueCore) error
	JoinLeague(leagueId, userId int) error

	// Permissions
	SetLeaguePermissions(leagueId, userId int, permissions LeaguePermissionsCore) error
	//GetLeaguePermissions(leagueId, userId int) (*LeaguePermissionsDTO, error)
	GetTeamManagerInformation(leagueId int) ([]*TeamWithManagers, error)
	IsLeagueViewable(leagueId, userId int) (bool, error)
	CanJoinLeague(leagueId, userId int) (bool, error)

	// Get Information About Leagues
	DoesLeagueExist(leagueId int) (bool, error)
	GetLeagueInformation(leagueId int) (*League, error)
	IsNameInUse(leagueId int, name string) (bool, error)
	GetPublicLeagueList() ([]*League, error)

	// Markdown
	GetMarkdownFile(leagueId int) (string, error)
	SetMarkdownFile(leagueId int, fileName string) error

	// Availabilities
	AddAvailability(leagueId int, availability AvailabilityCore) (int, error)
	GetAvailabilities(leagueId int) ([]*Availability, error)
	DeleteAvailability(availabilityId int) error

	AddWeeklyAvailability(leagueId int, availability WeeklyAvailabilityCore) (int, error)
	GetWeeklyAvailabilities(leagueId int) ([]*WeeklyAvailability, error)
	EditWeeklyAvailability(availabilityId int, availability WeeklyAvailabilityCore) error
	DeleteWeeklyAvailability(availabilityId int) error

	DoesAvailabilityExistInLeague(leagueId, availabilityId int) (bool, error)
}

type LeagueOfLegendsDAO

type LeagueOfLegendsDAO interface {
	CreateLoLPlayer(leagueId, teamId int, externalId string, playerInfo LoLPlayerCore) (int, error)
	CreateLoLTeamWithPlayers(leagueId, userId int, teamInfo TeamCore, players []*LoLPlayerCore, iconSmall, iconLarge string) (int, error)
	UpdateLoLPlayer(playerId int, externalId string, playerInfo LoLPlayerCore) error

	GetLoLTeamStub(teamId int) (*LoLTeamStub, error)
	GetAllLoLTeamStubInLeague(leagueId int) ([]*LoLTeamStub, error)

	ReportEndGameStats(leagueId, gameId int, match *LoLMatchInformation) error
	GetPlayerStats(leagueId int) ([]*LoLPlayerStats, error)
	GetTeamStats(leagueId int) ([]*LoLTeamStats, error)
	GetChampionStats(leagueId int) ([]*LoLChampionStats, error)

	RegisterTournamentProvider(leagueId, providerId, tournamentId int) error
	LeagueHasRegisteredTournament(leagueId int) (bool, error)
	GetTournamentId(leagueId int) (int, error)

	HasTournamentCode(gameId int) (bool, error)
	GetTournamentCode(gameId int) (string, error)
	CreateTournamentCode(gameId int, tournamentCode string) error
}

type LeaguePermissionsCore

type LeaguePermissionsCore struct {
	Administrator bool `json:"administrator"`
	CreateTeams   bool `json:"createTeams"`
	EditTeams     bool `json:"editTeams"`
	EditGames     bool `json:"editGames"`
}

func (*LeaguePermissionsCore) Validate

func (p *LeaguePermissionsCore) Validate() (bool, string, error)

type LoLChampionStats

type LoLChampionStats struct {
	Name    string  `json:"name"`
	Bans    int     `json:"bans"`
	Picks   int     `json:"picks"`
	Wins    int     `json:"wins"`
	Losses  int     `json:"losses"`
	Winrate float64 `json:"winrate"`
}

type LoLMatchInformation

type LoLMatchInformation struct {
	GameId                 string                `json:"gameId"`
	Duration               float64               `json:"duration"`
	Timestamp              int                   `json:"timestamp"`
	Team1Id                int                   `json:"team1Id"`
	Team2Id                int                   `json:"team2Id"`
	WinningTeamId          int                   `json:"winningTeamId"`
	LosingTeamId           int                   `json:"losingTeamId"`
	BannedChampions        []string              `json:"bannedChampions"`
	WinningChampions       []string              `json:"winningChampions"`
	LosingChampions        []string              `json:"losingChampions"`
	WinningTeamSummonerIds []string              `json:"winningTeamSummonerIds"`
	LosingTeamSummonerIds  []string              `json:"losingTeamSummonerIds"`
	WinningTeamStats       LoLMatchTeamStats     `json:"winningTeamStats"`
	LosingTeamStats        LoLMatchTeamStats     `json:"losingTeamStats"`
	PlayerStats            []LoLMatchPlayerStats `json:"playerStats"`
}

type LoLMatchPlayerStats

type LoLMatchPlayerStats struct {
	Id             string  `json:"id"`
	Name           string  `json:"name"`
	ChampionPicked string  `json:"championPicked"`
	Gold           float64 `json:"gold"`
	Cs             float64 `json:"cs"`
	Damage         float64 `json:"damage"`
	Kills          float64 `json:"kills"`
	Deaths         float64 `json:"deaths"`
	Assists        float64 `json:"assists"`
	Wards          float64 `json:"wards"`
	Win            bool    `json:"win"`
}

type LoLMatchTeamStats

type LoLMatchTeamStats struct {
	FirstBlood bool `json:"firstBlood"`
	FirstTower bool `json:"firstTower"`
	Side       int  `json:"side"`
}

type LoLPlayer

type LoLPlayer struct {
	PlayerId       int    `json:"playerId"`
	GameIdentifier string `json:"gameIdentifier"`
	MainRoster     bool   `json:"mainRoster"`
	Position       string `json:"position"`
	Rank           string `json:"rank"`
	Tier           string `json:"tier"`
}

type LoLPlayerCore

type LoLPlayerCore struct {
	GameIdentifier string `json:"gameIdentifier"`
	MainRoster     bool   `json:"mainRoster"`
	Position       string `json:"position"`
	ExternalId     string `json:"externalId"`
}

func (*LoLPlayerCore) ValidateEdit

func (player *LoLPlayerCore) ValidateEdit(leagueId, teamId, playerId int, leagueOfLegendsDAO LeagueOfLegendsDAO) (bool, string, error)

func (*LoLPlayerCore) ValidateNew

func (player *LoLPlayerCore) ValidateNew(leagueId, teamId int, leagueOfLegendsDAO LeagueOfLegendsDAO) (bool, string, error)

type LoLPlayerStats

type LoLPlayerStats struct {
	Id              string  `json:"id"`
	Name            string  `json:"name"`
	TeamId          int     `json:"teamId"`
	AverageDuration float64 `json:"averageDuration"`
	GoldPerMinute   float64 `json:"goldPerMinute"`
	CsPerMinute     float64 `json:"csPerMinute"`
	DamagePerMinute float64 `json:"damagePerMinute"`
	AverageKills    float64 `json:"averageKills"`
	AverageDeaths   float64 `json:"averageDeaths"`
	AverageAssists  float64 `json:"averageAssists"`
	AverageKda      float64 `json:"averageKda"`
	AverageWards    float64 `json:"averageWards"`
}

type LoLPlayerStub

type LoLPlayerStub struct {
	PlayerId   int
	ExternalId string
	MainRoster bool
	Position   string
}

type LoLTeamStats

type LoLTeamStats struct {
	Id                 string  `json:"id"`
	AverageDuration    float64 `json:"averageDuration"`
	NumberFirstBloods  int     `json:"numberFirstBloods"`
	NumberFirstTurrets int     `json:"numberFirstTurrets"`
	AverageKda         float64 `json:"averageKda"`
	AverageWards       float64 `json:"averageWards"`
	AverageActionScore float64 `json:"averageActionScore"`
	GoldPerMinute      float64 `json:"goldPerMinute"`
	CsPerMinute        float64 `json:"csPerMinute"`
}

type LoLTeamStub

type LoLTeamStub struct {
	TeamId           int
	Name             string
	Description      string
	Tag              string
	IconSmall        string
	IconLarge        string
	Wins             int
	Losses           int
	MainRoster       []*LoLPlayerStub
	SubstituteRoster []*LoLPlayerStub
}

type LoLTeamWithPlayersCore

type LoLTeamWithPlayersCore struct {
	Team    TeamCore         `json:"team"`
	Icon    string           `json:"icon"`
	Players []*LoLPlayerCore `json:"players"`
}

func (*LoLTeamWithPlayersCore) Validate

func (team *LoLTeamWithPlayersCore) Validate(leagueId int, teamDao TeamDAO) (bool, string, error)

type LoLTeamWithRosters

type LoLTeamWithRosters struct {
	TeamId           int          `json:"teamId"`
	Name             string       `json:"name"`
	Description      string       `json:"description"`
	Tag              string       `json:"tag"`
	IconSmall        string       `json:"iconSmall"`
	IconLarge        string       `json:"iconLarge"`
	Wins             int          `json:"wins"`
	Losses           int          `json:"losses"`
	MainRoster       []*LoLPlayer `json:"mainRoster"`
	SubstituteRoster []*LoLPlayer `json:"substituteRoster"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func (*LoginRequest) Validate

func (req *LoginRequest) Validate() (bool, string, error)

type Markdown

type Markdown struct {
	Markdown string `json:"markdown"`
}

func (*Markdown) Validate

func (md *Markdown) Validate() (bool, string, error)

type Player

type Player struct {
	PlayerId       int    `json:"playerId"`
	Name           string `json:"name"`
	GameIdentifier string `json:"gameIdentifier"`
	MainRoster     bool   `json:"mainRoster"`
}

type PlayerCore

type PlayerCore struct {
	Name           string `json:"name"`
	GameIdentifier string `json:"gameIdentifier"`
	MainRoster     bool   `json:"mainRoster"`
}

func (*PlayerCore) ValidateEdit

func (player *PlayerCore) ValidateEdit(leagueId, teamId, playerId int, teamDao TeamDAO) (bool, string, error)

func (*PlayerCore) ValidateNew

func (player *PlayerCore) ValidateNew(leagueId, teamId int, teamDao TeamDAO) (bool, string, error)

type SchedulingParameters

type SchedulingParameters struct {
	TournamentType    string `json:"tournamentType"`
	RoundsPerWeek     int    `json:"roundsPerWeek"`
	ConcurrentGameNum int    `json:"concurrentGameNum"`
	GameDuration      int    `json:"gameDuration"`
}

func (*SchedulingParameters) Validate

func (params *SchedulingParameters) Validate() (bool, string, error)

type SortedGames

type SortedGames struct {
	CompletedGames []*Game `json:"completedGames"`
	UpcomingGames  []*Game `json:"upcomingGames"`
}

type TeamCore

type TeamCore struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Tag         string `json:"tag"`
}

func (*TeamCore) ValidateEdit

func (team *TeamCore) ValidateEdit(leagueId, teamId int, teamDao TeamDAO) (bool, string, error)

func (*TeamCore) ValidateNew

func (team *TeamCore) ValidateNew(leagueId int, teamDao TeamDAO) (bool, string, error)

type TeamDAO

type TeamDAO interface {
	// Teams
	CreateTeam(leagueId, userId int, teamInfo TeamCore) (int, error)
	CreateTeamWithIcon(leagueId, userId int, teamInfo TeamCore, iconSmall, iconLarge string) (int, error)
	CreateTeamWithPlayers(leagueId, userId int, teamInfo TeamCore, players []PlayerCore, iconSmall, iconLarge string) (int, error)
	DeleteTeam(teamId int) error
	UpdateTeam(teamId int, teamInformation TeamCore) error
	UpdateTeamIcon(teamId int, small, large string) error
	GetTeamInformation(teamId int) (*TeamWithPlayers, error)
	GetTeamWithRosters(teamId int) (*TeamWithRosters, error)
	GetAllTeamsInLeague(leagueId int) ([]*TeamWithPlayers, error)
	GetAllTeamsInLeagueWithRosters(leagueId int) ([]*TeamWithRosters, error)
	GetAllTeamDisplaysInLeague(leagueId int) ([]*TeamDisplay, error)

	// Players
	CreatePlayer(leagueId, teamId int, playerInfo PlayerCore) (int, error)
	DeletePlayer(playerId int) error
	UpdatePlayer(playerId int, playerInfo PlayerCore) error

	// Get Information For Team and Player Management
	GetTeamPermissions(teamId, userId int) (*TeamPermissionsCore, error)
	IsInfoInUse(leagueId, teamId int, name, tag string) (bool, string, error)
	DoesTeamExistInLeague(leagueId, teamId int) (bool, error)
	IsTeamActive(leagueId, teamId int) (bool, error)
	DoesPlayerExist(leagueId, teamId, playerId int) (bool, error)

	// Managers
	ChangeManagerPermissions(teamId, userId int, teamPermissionInformation TeamPermissionsCore) error
}

type TeamDisplay

type TeamDisplay struct {
	TeamId    int    `json:"teamId"`
	Name      string `json:"name"`
	Tag       string `json:"tag"`
	IconSmall string `json:"iconSmall"`
	Wins      int    `json:"wins"`
	Losses    int    `json:"losses"`
}

type TeamManager

type TeamManager struct {
	UserId        int    `json:"userId"`
	Email         string `json:"email"`
	Administrator bool   `json:"administrator"`
	Information   bool   `json:"information"`
	Games         bool   `json:"games"`
}

type TeamPermissions

type TeamPermissions struct {
	TeamId        int    `json:"teamId"`
	Name          string `json:"name"`
	Tag           string `json:"tag"`
	IconSmall     string `json:"iconSmall"`
	Administrator bool   `json:"administrator"`
	Information   bool   `json:"information"`
	Games         bool   `json:"games"`
}

type TeamPermissionsCore

type TeamPermissionsCore struct {
	Administrator bool `json:"administrator"`
	Information   bool `json:"information"`
	Games         bool `json:"games"`
}

func (*TeamPermissionsCore) Validate

func (p *TeamPermissionsCore) Validate() (bool, string, error)

type TeamWithManagers

type TeamWithManagers struct {
	TeamId    int            `json:"teamId"`
	Name      string         `json:"name"`
	Tag       string         `json:"tag"`
	IconSmall string         `json:"iconSmall"`
	Managers  []*TeamManager `json:"managers"`
}

type TeamWithPlayers

type TeamWithPlayers struct {
	TeamId      int       `json:"teamId"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Tag         string    `json:"tag"`
	IconSmall   string    `json:"iconSmall"`
	IconLarge   string    `json:"iconLarge"`
	Wins        int       `json:"wins"`
	Losses      int       `json:"losses"`
	Players     []*Player `json:"players"`
}

type TeamWithPlayersCore

type TeamWithPlayersCore struct {
	Team    TeamCore     `json:"team"`
	Icon    string       `json:"icon"`
	Players []PlayerCore `json:"players"`
}

func (*TeamWithPlayersCore) Validate

func (team *TeamWithPlayersCore) Validate(leagueId int, teamDao TeamDAO) (bool, string, error)

type TeamWithRosters

type TeamWithRosters struct {
	TeamId           int       `json:"teamId"`
	Name             string    `json:"name"`
	Description      string    `json:"description"`
	Tag              string    `json:"tag"`
	IconSmall        string    `json:"iconSmall"`
	IconLarge        string    `json:"iconLarge"`
	Wins             int       `json:"wins"`
	Losses           int       `json:"losses"`
	MainRoster       []*Player `json:"mainRoster"`
	SubstituteRoster []*Player `json:"substituteRoster"`
}

type User

type User struct {
	UserId int    `json:"userId"`
	Email  string `json:"email"`
}

type UserAuthenticationDTO

type UserAuthenticationDTO struct {
	UserId int    `json:"userId"`
	Salt   string `json:"salt"`
	Hash   string `json:"hash"`
}

type UserCreationInformation

type UserCreationInformation struct {
	Email    string
	Password string
}

func (*UserCreationInformation) Validate

func (user *UserCreationInformation) Validate(userDao UserDAO) (bool, string, error)

UserCreationInformation

type UserDAO

type UserDAO interface {
	CreateUser(email, salt, hash string) (int, error)
	IsEmailInUse(email string) (bool, error)
	GetAuthenticationInformation(email string) (*UserAuthenticationDTO, error)
	GetUserProfile(userId int) (*User, error)
	GetUserWithPermissions(leagueId, userId int) (*UserWithPermissions, error)
}

type UserWithPermissions

type UserWithPermissions struct {
	UserId            int                    `json:"userId"`
	Email             string                 `json:"email"`
	LeaguePermissions *LeaguePermissionsCore `json:"leaguePermissions"`
	TeamPermissions   []*TeamPermissions     `json:"teamPermissions"`
}

type ValidateFunc

type ValidateFunc func(*string, *error) bool

Each incoming data structure should implement this to check data correctness

type WeeklyAvailability

type WeeklyAvailability struct {
	AvailabilityId int    `json:"availabilityId"`
	StartTime      int    `json:"startTime"`
	EndTime        int    `json:"endTime"`
	Weekday        string `json:"weekday"`
	Timezone       int    `json:"timezone"`
	Hour           int    `json:"hour"`
	Minute         int    `json:"minute"`
	Duration       int    `json:"duration"`
}

type WeeklyAvailabilityCore

type WeeklyAvailabilityCore struct {
	StartTime int    `json:"startTime"`
	EndTime   int    `json:"endTime"`
	Weekday   string `json:"weekday"`
	Timezone  int    `json:"timezone"`
	Hour      int    `json:"hour"`
	Minute    int    `json:"minute"`
	Duration  int    `json:"duration"`
}

func (*WeeklyAvailabilityCore) ValidateEdit

func (avail *WeeklyAvailabilityCore) ValidateEdit(leagueId, availabilityId int, leagueDao LeagueDAO) (bool, string, error)

func (*WeeklyAvailabilityCore) ValidateNew

func (avail *WeeklyAvailabilityCore) ValidateNew(leagueId int, leagueDao LeagueDAO) (bool, string, error)

Jump to

Keyboard shortcuts

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