timer

package
v0.0.0-...-519d529 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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