runs

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: 11 Imported by: 0

Documentation

Index

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

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

GetRun will return a run

func (RunController) GetRuns

GetRuns will return all runs from the mgo collection

func (RunController) MoveRun

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

Jump to

Keyboard shortcuts

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