Documentation ¶
Index ¶
- func NewTimeController(b *common.Controller, refreshInterval int, router *httprouter.Router)
- type Controller
- func (c *Controller) TimerFinish(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (c *Controller) TimerPause(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (c *Controller) TimerPlayerFinish(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (c *Controller) TimerReset(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (c *Controller) TimerResume(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (c *Controller) TimerStart(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTimeController ¶
func NewTimeController(b *common.Controller, refreshInterval int, router *httprouter.Router)
NewTimeController initializes and returns a new time controller. The refreshInterval is in ms
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the time controller
func (*Controller) TimerFinish ¶
func (c *Controller) TimerFinish(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
TimerFinish will be fired when all players are done, can also be manually called req state: running
func (*Controller) TimerPause ¶
func (c *Controller) TimerPause(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
TimerPause will pause the timer req state: running
func (*Controller) TimerPlayerFinish ¶
func (c *Controller) TimerPlayerFinish(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
TimerPlayerFinish will finish a specific player req state: running
func (*Controller) TimerReset ¶
func (c *Controller) TimerReset(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
TimerReset will reset the timer req state: finished
func (*Controller) TimerResume ¶
func (c *Controller) TimerResume(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
TimerResume will resume the timer req state: finished, pause
func (*Controller) TimerStart ¶
func (c *Controller) TimerStart(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
TimerStart will start the timer req state: stopped
Click to show internal directories.
Click to hide internal directories.