Documentation ¶
Index ¶
- func SetConfigDefaults(config *ProjectConfig)
- type CommitMetadata
- type ConfigDuration
- type DurationChannel
- type ITimerIntenalState
- type ITurnLogic
- type Participant
- type Participants
- type ProjectConfig
- type Repository
- type StatesMap
- type Timer
- type TimerInitialState
- type TimerInternalStateLabel
- type TimerStartedState
- type TimerTimeIsCriticalState
- type TimerTimeIsOkState
- type TimerTimeIsOverState
- type TimerWaitingNextParticipantState
- type TurnContext
- func (this *TurnContext) Reset()
- func (this *TurnContext) SetCriticalBeginIfNotDefined(t time.Time)
- func (this *TurnContext) SetTurnBeginIfNotDefined(t time.Time)
- func (this *TurnContext) Update(turnChannel DurationChannel, sessionChannel DurationChannel, t time.Time)
- func (this *TurnContext) UpdateSessionTime(sessionChannel DurationChannel, t time.Time)
- func (this *TurnContext) UpdateTurnTime(turnChannel DurationChannel, t time.Time)
- type TurnTimeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetConfigDefaults ¶
func SetConfigDefaults(config *ProjectConfig)
Types ¶
type CommitMetadata ¶
func CreateCommitMetadata ¶
func CreateCommitMetadata(name, email string, t time.Time) CommitMetadata
type ConfigDuration ¶
func (*ConfigDuration) UnmarshalText ¶
func (this *ConfigDuration) UnmarshalText(text []byte) error
type DurationChannel ¶
type ITimerIntenalState ¶
type ITimerIntenalState interface {
ChangeToState(ITurnLogic, time.Time) TimerInternalStateLabel
}
type ITurnLogic ¶
type Participant ¶
func ParticipantFromString ¶
func ParticipantFromString(s string) (Participant, error)
func (*Participant) Valid ¶
func (P *Participant) Valid() bool
type Participants ¶
type Participants struct {
// contains filtered or unexported fields
}
func BuildParticipantsFromArray ¶
func BuildParticipantsFromArray(participants []Participant) Participants
func LoadParticipantsFromFile ¶
func LoadParticipantsFromFile(filename string) (Participants, error)
func (*Participants) Get ¶
func (P *Participants) Get(index int) Participant
func (*Participants) Length ¶
func (P *Participants) Length() int
func (*Participants) NextIndex ¶
func (this *Participants) NextIndex(index int) int
func (*Participants) PreviousIndex ¶
func (this *Participants) PreviousIndex(index int) int
func (*Participants) Shuffle ¶
func (this *Participants) Shuffle()
type ProjectConfig ¶
type ProjectConfig struct { Session struct { ExerciseReference []string NotifyBadBehaviour bool `default:"false"` TurnTime ConfigDuration Critical ConfigDuration UseSoundNotification bool `default:"true"` UseSystemNotification bool `default:"true"` SoundNotificationFilename string `default:"sound.ogg"` LockScreenOnTimeout bool `default:"true"` ShuffleUsersOrder bool `default:"true"` } Tests struct { Command string OnEveryChange bool `default:"true"` OnTimeout ConfigDuration Files []string } Project struct { VC string `default:"Git"` CommitOnEveryChange bool `default:"true"` SourceFiles []string } Report struct { DbFile string `default:"db.jcdmdb"` } UI struct { Type string `default:"QML"` Skin string `default:"main.qml"` } }
func LoadProjectConfigFile ¶
func LoadProjectConfigFile(filename string) (ProjectConfig, error)
type Repository ¶
type Repository struct {
Repo *git.Repository
}
func CreateVcsRepository ¶
func CreateVcsRepository(dirName string) (Repository, error)
func (*Repository) CommitFiles ¶
func (this *Repository) CommitFiles(globs []string, meta CommitMetadata) error
type StatesMap ¶
type StatesMap map[TimerInternalStateLabel]ITimerIntenalState
type Timer ¶
type Timer struct { Context *TurnContext TurnLogic ITurnLogic CurrentStateLabel TimerInternalStateLabel States StatesMap TurnDurationChannel DurationChannel SessionDurationChannel DurationChannel }
func NewTimer ¶
func NewTimer(logic ITurnLogic, turnChannel DurationChannel, sessionChannel DurationChannel) *Timer
func (*Timer) CurrentState ¶
func (timer *Timer) CurrentState() ITimerIntenalState
type TimerInitialState ¶
type TimerInitialState struct { }
Implementing states
func (*TimerInitialState) ChangeToState ¶
func (this *TimerInitialState) ChangeToState(logic ITurnLogic, time time.Time) TimerInternalStateLabel
type TimerInternalStateLabel ¶
type TimerInternalStateLabel int
const ( STATE_INITIAL TimerInternalStateLabel = iota STATE_WAITING_NEXT_PARTICIPANT TimerInternalStateLabel = iota STATE_TIME_IS_OK TimerInternalStateLabel = iota STATE_TIME_IS_CRITICAL TimerInternalStateLabel = iota STATE_TIME_IS_OVER TimerInternalStateLabel = iota )
type TimerStartedState ¶
type TimerStartedState struct { }
type TimerTimeIsCriticalState ¶
type TimerTimeIsCriticalState struct {
Context *TurnContext
}
func (*TimerTimeIsCriticalState) ChangeToState ¶
func (this *TimerTimeIsCriticalState) ChangeToState(logic ITurnLogic, t time.Time) TimerInternalStateLabel
type TimerTimeIsOkState ¶
type TimerTimeIsOkState struct {
Context *TurnContext
}
func (*TimerTimeIsOkState) ChangeToState ¶
func (this *TimerTimeIsOkState) ChangeToState(logic ITurnLogic, t time.Time) TimerInternalStateLabel
type TimerTimeIsOverState ¶
type TimerTimeIsOverState struct { }
func (*TimerTimeIsOverState) ChangeToState ¶
func (this *TimerTimeIsOverState) ChangeToState(logic ITurnLogic, time time.Time) TimerInternalStateLabel
type TimerWaitingNextParticipantState ¶
type TimerWaitingNextParticipantState struct { }
func (*TimerWaitingNextParticipantState) ChangeToState ¶
func (this *TimerWaitingNextParticipantState) ChangeToState(logic ITurnLogic, time time.Time) TimerInternalStateLabel
type TurnContext ¶
type TurnContext struct { SessionBegin time.Time TurnBegin time.Time CriticalTime time.Time LastTurnDuration time.Duration LastSessionDuration time.Duration }
func (*TurnContext) Reset ¶
func (this *TurnContext) Reset()
func (*TurnContext) SetCriticalBeginIfNotDefined ¶
func (this *TurnContext) SetCriticalBeginIfNotDefined(t time.Time)
func (*TurnContext) SetTurnBeginIfNotDefined ¶
func (this *TurnContext) SetTurnBeginIfNotDefined(t time.Time)
func (*TurnContext) Update ¶
func (this *TurnContext) Update(turnChannel DurationChannel, sessionChannel DurationChannel, t time.Time)
func (*TurnContext) UpdateSessionTime ¶
func (this *TurnContext) UpdateSessionTime(sessionChannel DurationChannel, t time.Time)
func (*TurnContext) UpdateTurnTime ¶
func (this *TurnContext) UpdateTurnTime(turnChannel DurationChannel, t time.Time)
Click to show internal directories.
Click to hide internal directories.