Versions in this module Expand all Collapse all v0 deprecated v0.7.1 Oct 28, 2026 v0.7.0 Oct 22, 2026 Changes in this version type State + func (s *State) RulesPhase(i int) *rules.Phase v0.6.0 Oct 22, 2026 Changes in this version type Config + func (c Config) BreakIntervals() []rules.Interval type State + func (s *State) RulesMatches() []rules.Match v0.5.2 Oct 5, 2026 v0.5.1 Oct 5, 2026 Changes in this version + const JournalVersion + const KindBracket + const KindGSL + const KindLivesBracket + const KindRoundRobin + const KindSwissLives + const PrizeSectionAll + const RefusalDrawn + const RefusalFinished + const RefusalRemoved + const RefusalStarted + const SeedingRating + func New(cfg Config, seed int64, now time.Time) (*State, Event, error) + func PhaseName(p PhaseConfig) string + func Prizes(ranking []Rank, prizes []float64) map[PlayerID]float64 + func SectionName(name string) string + type Absence struct + Phase int + Round int + Until time.Time + type Action struct + A PlayerID + B PlayerID + Draw *Draw + Key string + Kind ActionKind + Label Label + Length int + Match MatchID + Phase int + Reason ReasonCode + Round int + Section string + Table int + Until time.Time + Warn WarningCode + func (a Action) String() string + type ActionKind string + const ActBye + const ActCancelMatch + const ActDraw + const ActFinish + const ActNextPhase + const ActRepechage + const ActStartMatch + const ActWait + type Clock struct + AvgMatch time.Duration + AvgPerPt time.Duration + Elapsed time.Duration + Played int + Running int + type Config struct + Breaks []TimeRange + MinPerPoint float64 + Name string + Phases []PhaseConfig + Prizes PrizePool + Tables Tables + func ParseConfig(b []byte) (*Config, error) + func (c *Config) Validate() error + type ConfigRefusal struct + Field string + From string + Opened int + Phase int + Reason string + To string + func (r *ConfigRefusal) Error() string + type Draw struct + Groups [][]PlayerID + Lives map[PlayerID]int + Slots []PlayerID + type Event struct + A PlayerID + AfterCurrent bool + B PlayerID + Config *Config + Draw *Draw + Forfeit bool + ID PlayerID + Key string + Kind EventKind + Label Label + Length int + MatchID MatchID + Phase int + Player *Player + Round int + ScoreA int + ScoreB int + Section string + Seed int64 + Seq int + Slot string + Table int + Text string + Time time.Time + Until *time.Time + Version int + Winner PlayerID + func CancelEvent(id MatchID, now time.Time) Event + func ConfigChangedEvent(cfg Config, now time.Time) Event + func CorrectionEvent(id MatchID, winner PlayerID, scoreA, scoreB int, now time.Time) Event + func ForfeitEvent(id MatchID, winner PlayerID, now time.Time) Event + func LengthChangedEvent(phase, length int, now time.Time) Event + func NoteEvent(text string, now time.Time) Event + func PlayerAddedAtSlotEvent(p Player, slot Slot, now time.Time) Event + func PlayerAddedEvent(p Player, now time.Time) Event + func PlayerAvailableEvent(id PlayerID, now time.Time) Event + func PlayerUnavailableEvent(id PlayerID, until time.Time, now time.Time) Event + func PlayerUnavailableUntilRoundEvent(id PlayerID, round int, now time.Time) Event + func PlayerUpdatedEvent(p Player, now time.Time) Event + func PlayerWithdrawnAfterCurrentEvent(id PlayerID, now time.Time) Event + func PlayerWithdrawnEvent(id PlayerID, now time.Time) Event + func ReopenedEvent(now time.Time) Event + func RepechageEvent(phase int, section string, withdrawn, replacement PlayerID, now time.Time) Event + func ResultEvent(id MatchID, winner PlayerID, scoreA, scoreB int, now time.Time) Event + func TableChangedEvent(id MatchID, table int, now time.Time) Event + func (e Event) WithNote(text string) Event + type EventKind string + const EvBye + const EvConfigChanged + const EvCreated + const EvDraw + const EvFinished + const EvLengthChanged + const EvMatchCancelled + const EvMatchStarted + const EvNextPhase + const EvNote + const EvPlayerAdded + const EvPlayerAvailable + const EvPlayerUnavailable + const EvPlayerUpdated + const EvPlayerWithdrawn + const EvReopened + const EvRepechage + const EvResult + const EvResultCorrected + const EvTableChanged + type External struct + BusyPlayers []PlayerID + BusyTables []int + type GMatch struct + Cond bool + CondFrom int + CondSide int + Done bool + Key string + Label Label + Length int + Loser PlayerID + MatchID MatchID + Players [2]PlayerID + Skipped bool + Src [2]Src + Walkover bool + Winner PlayerID + type Info struct + Code InfoCode + Label Label + Phase int + Player PlayerID + Section string + func (i Info) String() string + type InfoCode string + const InfoEntersAt + const InfoNoEntry + type Journal []Event + func ParseJournal(b []byte) (Journal, error) + func (j Journal) Bytes() ([]byte, error) + type Label struct + Kind LabelKind + Losses int + Match int + N int + Players int + Section string + Spots int + Sub *Label + Text string + func (l *Label) UnmarshalJSON(b []byte) error + func (l Label) Empty() bool + func (l Label) String() string + type LabelKind string + const LabelBarrage + const LabelBarrageCross + const LabelBarrageName + const LabelBracketRound + const LabelConsolationFinal + const LabelConsolationRound + const LabelCrossed + const LabelDecider + const LabelDrawBarrage + const LabelDrawBlock + const LabelDrawBracket + const LabelDrawPools + const LabelFinal + const LabelGrandFinal + const LabelGrandFinalRecharge + const LabelInBlock + const LabelInSection + const LabelLastChance + const LabelLosersMatch + const LabelMainDraw + const LabelNone + const LabelOpening + const LabelPhase + const LabelPoolName + const LabelPoolRound + const LabelQuarterFinal + const LabelRematch + const LabelRepechage + const LabelRound + const LabelSectionConso + const LabelSectionFinals + const LabelSectionLast + const LabelSectionMain + const LabelSemiFinal + const LabelSingleElim + const LabelSingleMatch + const LabelSwissGroup + const LabelWinnersMatch + type Match struct + A PlayerID + B PlayerID + End time.Time + Forfeit bool + ID MatchID + Key string + Label Label + Length int + Phase int + Round int + ScoreA int + ScoreB int + Section string + Start time.Time + Status MatchStatus + Table int + Winner PlayerID + func (m *Match) Has(p PlayerID) bool + func (m *Match) Loser() PlayerID + type MatchID string + type MatchStatus string + const Cancelled + const Finished + const Running + type Note struct + Kind NoteKind + Lives int + Losses int + Qualified bool + Section string + Sub *Label + Wins int + func (n Note) String() string + type NoteKind string + const NoteAlive + const NoteAwaitingDraw + const NoteFinalist + const NoteForfeit + const NoteNone + const NotePoolRecord + const NoteRecord + const NoteRunning + const NoteSectionExit + const NoteSectionWinner + const NoteUnranked + const NoteWinner + const NoteWithdrawn + type PhaseConfig struct + AllowRematch bool + AvoidClubs bool + BatchMinutes int + Consolation bool + Entry string + FinalLength int + GroupSize int + Kind string + LastChance bool + LateThreshold int + Length int + LengthLate int + Lengths []int + Lives int + Mode string + Name string + Pairing string + Qualifiers int + Recharge bool + Reconciliation bool + Seeding string + Target int + type PhaseState struct + ByeRounds map[PlayerID][]int + Byes map[PlayerID]int + Cfg PhaseConfig + Done bool + Drawn bool + ElimOrder []PlayerID + Entrants []PlayerID + Index int + Length int + Lives map[PlayerID]int + Losses map[PlayerID]int + Opponents map[PlayerID][]PlayerID + Repechages map[PlayerID]PlayerID + Roster []PlayerID + Round int + Sections []*Section + Started bool + Wins map[PlayerID]int + type Player struct + Club string + ID PlayerID + Name string + Rating float64 + type PlayerID string + const BYE + type PlayerStatus struct + Kind StatusKind + Label Label + Phase int + Player PlayerID + Round int + Section string + func (p PlayerStatus) String() string + type PrizePool struct + EntryFee float64 + Retention Retention + Sections map[string]PrizeScale + func (p *PrizePool) UnmarshalJSON(b []byte) error + func (p PrizePool) Empty() bool + func (p PrizePool) SectionNames() []string + type PrizeScale struct + Amounts []float64 + Percents []float64 + type Rank struct + Note Note + Player PlayerID + Rank int + type ReasonCode string + const ReasonMatchesRunning + const ReasonNoPairing + const ReasonNone + const ReasonPlayerBusy + const ReasonPlayerUnavailable + const ReasonWaitingBatch + const ReasonWaitingTable + func (r ReasonCode) String() string + type Retention struct + Amount float64 + Percent float64 + type Section struct + Block int + Group int + Kind string + Matches []GMatch + Name string + Players []PlayerID + Rounds [][]int + Spots int + type Slot struct + Key string + Label Label + Phase int + Section string + type Src struct + From int + Loser bool + Player PlayerID + Section string + type State struct + Config Config + Current int + Final []Rank + Finished bool + Infos []Info + Last time.Time + MatchOrder []MatchID + Matches map[MatchID]*Match + NEvents int + Order []PlayerID + Phases []*PhaseState + Players map[PlayerID]*Player + Revived map[PlayerID]bool + Seed int64 + Unavailable map[PlayerID]Absence + Warnings []Warning + WithdrawAfter map[PlayerID]bool + Withdrawn map[PlayerID]bool + func Replay(j Journal) (*State, error) + func (s *State) Apply(ev Event) error + func (s *State) CheckConfig(next Config) error + func (s *State) ClockAt(now time.Time, start time.Time) Clock + func (s *State) Distributable() float64 + func (s *State) EventFromAction(a Action, now time.Time) (Event, error) + func (s *State) Expected(n int) time.Duration + func (s *State) FreeSlots() []Slot + func (s *State) Pool() float64 + func (s *State) PrizeAmounts(section string) []float64 + func (s *State) Propose() []Action + func (s *State) ProposeAt(now time.Time) []Action + func (s *State) ProposeWith(now time.Time, ext External) []Action + func (s *State) Ranking() []Rank + func (s *State) Running() []*Match + func (s *State) SectionPrizes(section string) map[PlayerID]float64 + func (s *State) SectionRanking(name string) []Rank + func (s *State) SlowMatches(now time.Time, facteur float64) []*Match + func (s *State) StandingsCSV() []byte + func (s *State) StatusOf(p PlayerID) PlayerStatus + func (s *State) Statuses() []PlayerStatus + func (s *State) Step(evs ...Event) ([]Action, error) + type StatusKind string + const StatusBye + const StatusEliminated + const StatusNotEntered + const StatusPlaying + const StatusQualified + const StatusUndecided + const StatusWinner + const StatusWithdrawn + type TableRule struct + AllPhases bool + Phase int + Section string + Table int + type Tables struct + Count int + Reserved []TableRule + Unavailable []int + func (t *Tables) UnmarshalJSON(b []byte) error + func (t Tables) AvailableFor(n int, section string, phase int) bool + type TimeRange struct + End time.Time + Start time.Time + type Warning struct + A PlayerID + B PlayerID + Code WarningCode + ExpectedA PlayerID + ExpectedB PlayerID + Label Label + Length int + Match MatchID + Other MatchID + Player PlayerID + ScoreA int + ScoreB int + Section string + Table int + func (w Warning) String() string + type WarningCode string + const WarnBracketWrongPlayers + const WarnCorrectionEliminatesRunning + const WarnCorrectionRevives + const WarnEndsInBreak + const WarnScoreOverLength + const WarnSlowMatch + const WarnTableShared v0.5.0 Oct 4, 2026 v0.4.1 Sep 26, 2026 v0.4.0 Sep 26, 2026 v0.3.0 Sep 26, 2026 v0.2.1 Sep 7, 2026 v0.2.0 Sep 7, 2026 v0.1.0 Sep 7, 2026