Documentation ¶
Overview ¶
Package opendata provides functions to fetch data from the UniBo Open Data portal.
It is useful in particular to get degrees (see GetDegrees).
Index ¶
Constants ¶
const ( // PackageDegreeProgrammesId is the id of the package containing the degrees. PackageDegreeProgrammesId = "degree-programmes" // ResourceDegreeProgrammesAlias is the alias of the resource containing the // degrees. ResourceDegreeProgrammesAlias = "corsi_latest_it" )
Variables ¶
This section is empty.
Functions ¶
func GetDegrees ¶
GetDegrees fetches and returns the degrees available in the open data for the current year.
Internally it uses PackageDegreeProgrammesId and ResourceDegreeProgrammesAlias constants to get the wanted package and resource and then parses the csv file to get the degrees.
If you'd like to get the package and resource yourself (maybe you want to download the csv file), you can use FetchPackage and Resources.GetByAlias.
Types ¶
type Package ¶
Package represents a package in the UniBO Open Data portal.
func FetchPackage ¶
FetchPackage retrieves the package with the given id from the Unibo Open Data portal.
If the package is found, it returns a pointer to the package. Otherwise, it returns nil and an error.
type Resource ¶
type Resource struct { Frequency string `json:"frequency"` Url string `json:"url"` Id string `json:"id"` PackageId string `json:"package_id"` LastMod string `json:"last_modified"` Alias string `json:"alias"` }
Resource represents a resource in the UniBO Open Data portal.