jacodoma

package
v0.0.0-...-6593a21 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2015 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfigDefaults

func SetConfigDefaults(config *ProjectConfig)

Types

type CommitMetadata

type CommitMetadata struct {
	Name  string
	Email string
	Time  time.Time
}

func CreateCommitMetadata

func CreateCommitMetadata(name, email string, t time.Time) CommitMetadata

type ConfigDuration

type ConfigDuration time.Duration

func (*ConfigDuration) UnmarshalText

func (this *ConfigDuration) UnmarshalText(text []byte) error

type DurationChannel

type DurationChannel chan time.Duration

type ITimerIntenalState

type ITimerIntenalState interface {
	ChangeToState(ITurnLogic, time.Time) TimerInternalStateLabel
}

type ITurnLogic

type ITurnLogic interface {
	OnTimeGetsCritical(time.Time)
	OnNextParticipantStarts(time.Time)
	OnTimeIsOver(time.Time)
	OnStartsWaitingNextParticipant(time.Time, int)
	NextParticipantIndex() int
	TurnTimeInfo() *TurnTimeInfo
	NextParticipantIsReady() bool
	BlockSession(time.Time)
}

type Participant

type Participant struct {
	Name  string
	Email string
}

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 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

func (*Timer) Step

func (timer *Timer) Step(t time.Time)

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

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

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)

type TurnTimeInfo

type TurnTimeInfo struct {
	// Duration of the "Non Critical" time,
	// when the participant can relax and code
	RelaxAndCodeDuration time.Duration

	// Duration of Time the participant has to hurry up
	// because the time is ending
	HurryUpDuration time.Duration
}

Jump to

Keyboard shortcuts

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