Documentation ¶
Index ¶
- func NewRunController(b *common.Controller, router *httprouter.Router)
- type RunController
- func (rc RunController) ActiveRuns(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (rc RunController) AddRun(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (rc RunController) DeleteRun(w http.ResponseWriter, _ *http.Request, ps httprouter.Params)
- func (rc RunController) GetRun(w http.ResponseWriter, _ *http.Request, ps httprouter.Params)
- func (rc RunController) GetRuns(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (rc RunController) MoveRun(w http.ResponseWriter, _ *http.Request, ps httprouter.Params)
- func (rc RunController) RefreshLayout(_ http.ResponseWriter, _ *http.Request, _ httprouter.Params)
- func (rc *RunController) SwitchRun(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (rc RunController) UpdateRun(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (rc *RunController) UploadRunJSON(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRunController ¶
func NewRunController(b *common.Controller, router *httprouter.Router)
NewRunController returns a new run controller
Types ¶
type RunController ¶
type RunController struct {
// contains filtered or unexported fields
}
RunController contains all the methods needed to control runs
func (RunController) ActiveRuns ¶
func (rc RunController) ActiveRuns(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
func (RunController) AddRun ¶
func (rc RunController) AddRun(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
AddRun will add a run to the database and return the ID of the new run
func (RunController) DeleteRun ¶
func (rc RunController) DeleteRun(w http.ResponseWriter, _ *http.Request, ps httprouter.Params)
DeleteRun will delete a run with the provided id
func (RunController) GetRun ¶
func (rc RunController) GetRun(w http.ResponseWriter, _ *http.Request, ps httprouter.Params)
GetRun will return a run
func (RunController) GetRuns ¶
func (rc RunController) GetRuns(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
GetRuns will return all runs from the mgo collection
func (RunController) MoveRun ¶
func (rc RunController) MoveRun(w http.ResponseWriter, _ *http.Request, ps httprouter.Params)
MoveRun takes the run by id and moves it after the run provided by after to do this we have to pull every run from the collection, then delete every run in the db do the moving and insert all the records into the db again which is kinda stupid tbh
func (RunController) RefreshLayout ¶
func (rc RunController) RefreshLayout(_ http.ResponseWriter, _ *http.Request, _ httprouter.Params)
RefreshLayout will send a WsCurrentUpdate to refresh the layout
func (*RunController) SwitchRun ¶
func (rc *RunController) SwitchRun(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
SwitchRun will update the currently active, upcoming and previous run based on the current run index
func (RunController) UpdateRun ¶
func (rc RunController) UpdateRun(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
UpdateRun will update the run with the id provided and the request body
func (*RunController) UploadRunJSON ¶
func (rc *RunController) UploadRunJSON(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
UploadRunJSON will take a json and import the runs