domain

package
v0.0.0-...-d7fecdb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CompetitionPhaseFinal       = competitionPhase("final")
	CompetitionPhasePreliminary = competitionPhase("preliminary")
)

Functions

func IsErrorTeamMembersEnough

func IsErrorTeamMembersEnough(err error) bool

func TeamLeaderRole

func TeamLeaderRole() string

Types

type City

type City interface {
	City() string
}

City

func NewCity

func NewCity(v string) (City, error)

type Competition

type Competition struct {
	CompetitionSummary

	Doc        URL
	Forum      Forum
	Winners    Winners
	DatasetDoc URL
	DatasetURL URL

	Type  CompetitionType
	Phase CompetitionPhase
	Order CompetitionScoreOrder
}

func (*Competition) IsFinal

func (c *Competition) IsFinal() bool

func (*Competition) IsOver

func (c *Competition) IsOver() bool

func (*Competition) IsPreliminary

func (c *Competition) IsPreliminary() bool

type CompetitionBonus

type CompetitionBonus interface {
	CompetitionBonus() int
}

CompetitionBonus

func NewCompetitionBonus

func NewCompetitionBonus(v int) (CompetitionBonus, error)

type CompetitionDesc

type CompetitionDesc interface {
	CompetitionDesc() string
}

CompetitionDesc

func NewCompetitionDesc

func NewCompetitionDesc(v string) (CompetitionDesc, error)

type CompetitionDuration

type CompetitionDuration interface {
	CompetitionDuration() string
}

CompetitionDuration

func NewCompetitionDuration

func NewCompetitionDuration(v string) (CompetitionDuration, error)

type CompetitionHost

type CompetitionHost interface {
	CompetitionHost() string
}

func NewCompetitionHost

func NewCompetitionHost(v string) (CompetitionHost, error)

type CompetitionIdentity

type CompetitionIdentity interface {
	CompetitionIdentity() string
}

CompetitionIdentity

func NewcompetitionIdentity

func NewcompetitionIdentity(v string) (CompetitionIdentity, error)

type CompetitionName

type CompetitionName interface {
	CompetitionName() string
}

CompetitionName

func NewCompetitionName

func NewCompetitionName(v string) (CompetitionName, error)

type CompetitionPhase

type CompetitionPhase interface {
	CompetitionPhase() string
	IsFinal() bool
	IsPreliminary() bool
}

CompetitionPhase

func NewCompetitionPhase

func NewCompetitionPhase(v string) (CompetitionPhase, error)

type CompetitionScoreOrder

type CompetitionScoreOrder interface {
	IsBetterThanB(a, b float32) bool
}

CompetitionScoreOrder

func NewCompetitionScoreOrder

func NewCompetitionScoreOrder(b bool) CompetitionScoreOrder

type CompetitionStatus

type CompetitionStatus interface {
	CompetitionStatus() string
	IsOver() bool
}

CompetitionStatus

func NewCompetitionStatus

func NewCompetitionStatus(v string) (CompetitionStatus, error)

type CompetitionSummary

type CompetitionSummary struct {
	Id       string
	Name     CompetitionName
	Desc     CompetitionDesc
	Host     CompetitionHost
	Bonus    CompetitionBonus
	Status   CompetitionStatus
	Duration CompetitionDuration
	Poster   URL
	Tags     []CompetitionTag
	Lang     Language
}

type CompetitionTag

type CompetitionTag interface {
	CompetitionTag() string
}

CompetitionTag

func NewCompetitionTag

func NewCompetitionTag(v string) (CompetitionTag, error)

type CompetitionType

type CompetitionType interface {
	CompetitionType() string
}

CompetitionType

func NewCompetitionType

func NewCompetitionType(v string) (CompetitionType, error)

type Competitor

type Competitor struct {
	Account  types.Account
	Name     CompetitorName
	City     City
	Email    types.Email
	Phone    Phone
	Identity CompetitionIdentity
	Province Province
	Detail   map[string]string
}

type CompetitorAppliedEvent

type CompetitorAppliedEvent struct {
	Account         types.Account
	CompetitionName types.CompetitionName
}

CompetitorAppliedEvent

type CompetitorName

type CompetitorName interface {
	CompetitorName() string
}

CompetitorName

func NewCompetitorName

func NewCompetitorName(v string) (CompetitorName, error)

type Forum

type Forum interface {
	Forum() string
}

Forum

func NewForum

func NewForum(v string) (Forum, error)

type Language

type Language interface {
	Language() string
}

Language

func NewLanguage

func NewLanguage(v string) (Language, error)

type PhaseSubmission

type PhaseSubmission struct {
	Phase CompetitionPhase

	Submission
}

PhaseSubmission

type Phone

type Phone interface {
	Phone() string
}

Phone

func NewPhone

func NewPhone(v string) (Phone, error)

type Player

type Player struct {
	PlayerIndex
	IsFinalist bool

	Leader Competitor
	Team   Team
	// contains filtered or unexported fields
}

func (*Player) ChangeTeamName

func (p *Player) ChangeTeamName(name TeamName) error

func (*Player) CompetitorsCount

func (p *Player) CompetitorsCount() int

func (*Player) CreateTeam

func (p *Player) CreateTeam(name TeamName) error

func (*Player) Delete

func (p *Player) Delete(c types.Account) error

func (*Player) Has

func (p *Player) Has(u types.Account) bool

func (*Player) IsATeam

func (p *Player) IsATeam() bool

func (*Player) IsIndividual

func (p *Player) IsIndividual() bool

func (*Player) IsIndividualOrLeader

func (p *Player) IsIndividualOrLeader() bool

func (*Player) JoinTo

func (p *Player) JoinTo(team *Player) error

func (*Player) Members

func (p *Player) Members() []Competitor

func (*Player) Name

func (p *Player) Name() string

func (*Player) Quit

func (p *Player) Quit() error

func (*Player) RoleOfCurrentCompetitor

func (p *Player) RoleOfCurrentCompetitor() string

func (*Player) SetCurrentUser

func (p *Player) SetCurrentUser(a types.Account)

func (*Player) TransferLeader

func (p *Player) TransferLeader(newOne types.Account) error

type PlayerIndex

type PlayerIndex struct {
	Id            string
	CompetitionId string
}

Player

func NewPlayerIndex

func NewPlayerIndex(cid, pid string) PlayerIndex

type Province

type Province interface {
	Province() string
}

Province

func NewProvince

func NewProvince(v string) (Province, error)

type Submission

type Submission struct {
	Id       string
	Status   string
	OBSPath  string
	SubmitAt int64
	Score    float32
}

Submission

type SubmissionService

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

SubmissionService

func (*SubmissionService) Submit

func (s *SubmissionService) Submit(
	w *Work, phase CompetitionPhase, fileName string, data io.Reader,
) (PhaseSubmission, error)

type SubmissionUpdatingInfo

type SubmissionUpdatingInfo struct {
	Index  WorkIndex
	Phase  CompetitionPhase
	Id     string
	Status string
	Score  float32
}

SubmissionUpdatingInfo

type Team

type Team struct {
	Name    TeamName
	Members []Competitor
}

Team

type TeamName

type TeamName interface {
	TeamName() string
}

TeamName

func NewTeamName

func NewTeamName(v string) (TeamName, error)

type TeamRole

type TeamRole interface {
	TeamRole() string
	IsLeader() bool
}

TeamRole

func NewTeamRole

func NewTeamRole(v string) (TeamRole, error)

type URL

type URL interface {
	URL() string
}

URL

func NewURL

func NewURL(v string) (URL, error)

type Winners

type Winners interface {
	Winners() string
}

Winners

func NewWinners

func NewWinners(v string) (Winners, error)

type Work

type Work struct {
	WorkIndex

	PlayerName string

	Repo        string
	Final       []Submission
	Preliminary []Submission
}

Work

func NewWork

func NewWork(cid string, p *Player) Work

func (*Work) BestOne

func (w *Work) BestOne(phase CompetitionPhase, order CompetitionScoreOrder) (
	r *Submission,
)

func (*Work) HasSubmittedToday

func (w *Work) HasSubmittedToday(phase CompetitionPhase) bool

func (*Work) NewSubmissionMessage

func (w *Work) NewSubmissionMessage(s *PhaseSubmission) WorkSubmittedEvent

func (*Work) Submissions

func (w *Work) Submissions(phase CompetitionPhase) []Submission

func (*Work) UpdateSubmission

func (w *Work) UpdateSubmission(info *SubmissionUpdatingInfo) *Submission

type WorkIndex

type WorkIndex struct {
	PlayerId      string
	CompetitionId string
}

func NewWorkIndex

func NewWorkIndex(cid, pid string) WorkIndex

type WorkSubmittedEvent

type WorkSubmittedEvent struct {
	Id            string `json:"id"`
	Phase         string `json:"phase"`
	OBSPath       string `json:"obs_path"`
	PlayerId      string `json:"pid"`
	CompetitionId string `json:"cid"`
}

WorkSubmittedEvent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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