routes

package
v0.0.0-...-603a23b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIErrorMessage

type APIErrorMessage struct {
	Message string `json:"message"`
	Error   error  `json:"error"`
}

func NewAPIError

func NewAPIError(message string, error error) *APIErrorMessage

func (*APIErrorMessage) Throw

func (e *APIErrorMessage) Throw(c *gin.Context, status int)

type APIMessage

type APIMessage struct {
	Message string `json:"message"`
}

func NewAPIMessage

func NewAPIMessage(message string) *APIMessage

func (*APIMessage) Throw

func (e *APIMessage) Throw(c *gin.Context)

type Controller

type Controller struct{}

func NewController

func NewController() *Controller

func (*Controller) GetAll

func (*Controller) GetClass

func (ctl *Controller) GetClass(class string) (structs.SubstituteResponse, *APIErrorMessage)

func (*Controller) GetList

func (ctl *Controller) GetList() ([]string, error)

func (*Controller) List

func (ctl *Controller) List(c *gin.Context)

Root endpoint for listing all classes

func (*Controller) ListTeachers

func (ctl *Controller) ListTeachers(c *gin.Context)

func (*Controller) Parser

func (ctl *Controller) Parser(c *gin.Context)

Parser function for returning the endpoint at /routes/c/{class}

func (*Controller) Teacher

func (ctl *Controller) Teacher(c *gin.Context)

Teacher endpoint for the teacher view

func (*Controller) Version

func (ctl *Controller) Version(c *gin.Context)

Version endpoint for showing the current git commit and version history

Jump to

Keyboard shortcuts

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