public

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx *gin.Context, model *models.Subject)

Get takes the subject model and returns its response view object

func GetCourses

func GetCourses(ctx *gin.Context, courses []*models.Course)

GetCourses takes the course models and returns its response view objects

func GetInstitutes

func GetInstitutes(ctx *gin.Context, institutes []models.Institute)

GetInstitutes takes the institute models and returns its response view objects

func GetOfferingComments added in v1.6.0

func GetOfferingComments(ctx *gin.Context, comments []*models.Comment)

GetOfferingComments takes the comments models and returns their view response objects

It also sorts comments to display most upvoted (and least downvoted) on top

func GetOfferingsWithStats added in v1.6.0

func GetOfferingsWithStats(
	ctx *gin.Context,
	IDs []string,
	offerings []*models.Offering,
	stats []*models.OfferingStats,
	limit int,
)

GetOfferingsWithStats takes the offering models and returns their view response objects

It also takes IDs of the professors for each offering (given that this information is not stored in the model directly) Finally, it sorts the offerings to display most interesting ones on top

func GetProfessors added in v1.5.5

func GetProfessors(ctx *gin.Context, professors []*models.Professor)

GetProfessors takes the professor models and returns its response view objects

func GetRelations

func GetRelations(ctx *gin.Context, model *models.Subject, weak, strong []models.Subject)

GetRelations takes the subject model and its weak and strong successors It returns the view object for its graph

func GetSiblingSubjects added in v1.5.9

func GetSiblingSubjects(ctx *gin.Context, siblings []*views.SubjectSibling)

GetSiblingSubjects is a dummy function that returns the sibling subjects

func GetStats

func GetStats(
	ctx *gin.Context,
	stats *models.Stats,
)

GetStats takes the calculated statistics and sets the output object as the response

func ListSubjects added in v1.6.1

func ListSubjects(ctx *gin.Context, model *models.Course)

func SearchSubjects added in v1.6.1

func SearchSubjects(ctx *gin.Context, model *models.Course)

SearchSubjects takes the course model and returns its response view object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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