Documentation ¶
Index ¶
- type APIErrorMessage
- type APIMessage
- type Controller
- func (ctl *Controller) GetAll() ([]structs.SubstituteResponse, *APIErrorMessage)
- func (ctl *Controller) GetClass(class string) (structs.SubstituteResponse, *APIErrorMessage)
- func (ctl *Controller) GetList() ([]string, error)
- func (ctl *Controller) List(c *gin.Context)
- func (ctl *Controller) ListTeachers(c *gin.Context)
- func (ctl *Controller) Parser(c *gin.Context)
- func (ctl *Controller) Teacher(c *gin.Context)
- func (ctl *Controller) Version(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIErrorMessage ¶
func NewAPIError ¶
func NewAPIError(message string, error error) *APIErrorMessage
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 (ctl *Controller) GetAll() ([]structs.SubstituteResponse, *APIErrorMessage)
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
Click to show internal directories.
Click to hide internal directories.