department

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package department provides functionality to fetch university departments and their teachers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Department

type Department struct {
	Name string // The name is the name of the department, e.g. "Informatica - Scienza e Ingegneria"
	Code string // The code is the subdomain of the department website, e.g. "disi" for "https://disi.unibo.it/it"
}

Department represents a department of the university.

func FetchDepartments

func FetchDepartments() ([]Department, error)

FetchDepartments retrieves the list of departments of the university.

It gets the list from the university website via HTTP and then applies a regex to parse the HTML.

func (Department) FetchTeachers

func (d Department) FetchTeachers() ([]Teacher, error)

func (Department) GetTeachersUrl

func (d Department) GetTeachersUrl() string

func (Department) Url

func (d Department) Url() string

type Teacher

type Teacher struct {
	Username string
}

Teacher represents a teacher.

func FetchTeachers

func FetchTeachers(departmentCode string) ([]Teacher, error)

FetchTeachers retrieves the list of teachers for the given department.

func (Teacher) GetWebsite

func (t Teacher) GetWebsite() string

GetWebsite returns the website of the teacher.

Jump to

Keyboard shortcuts

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