controllers

package
v0.0.0-...-52da073 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 11 Imported by: 0

README

rpi3/API_REST/app/controllers/

This folder contains the implementation of some controllers for different responsibilities of the system of which the API takes care of.

classrooms.go

Contains the functions and methods needed to get the classrooms status and occupation.

crawler.go

Web crawler that gets the today reservations from the laboratory web site.

ssh.go

Remote SSH execution of the Lázaro's scripts to check computers status and occupation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskOccupation

func AskOccupation(server, command string) *[]byte

AskOccupation asks control server for classroom occupation. Returns a string with the output. Returns an empty string in case of error

func GetClassroomsOccupation

func GetClassroomsOccupation(server, command string) *models.Occupation

GetClassroomsOccupation returns a struct with classrooms occupations statistics

func GetClassroomsStatus

func GetClassroomsStatus(reservations []*models.Reservation) *models.Classrooms

GetClassroomsStatus returns a struct whit classroom status Valid status are: 0 - free, 1 - occupied, 2 - will be occupied in the next 30 minutes, 3 - will be occupied in the next 10 minutes

func GetTodayReservations

func GetTodayReservations(url string) []*models.Reservation

GetTodayReservations returns a slice of pointers to models.Reservation struct with today reservations

Types

This section is empty.

Jump to

Keyboard shortcuts

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