friedolin

package
v0.0.0-...-aabad81 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoRepetition = iota
	OnlySummer
	OnlyWinter
	Every
)

Variables

View Source
var (
	ErrLoggedOut                = errors.New("friedolin: logged out")
	ErrFunctionalityUnavailable = errors.New("friedolin: functionality currently unavailable")
	ErrWrongCredentials         = errors.New("friedolin: wrong credentials")
	ErrUnavailable              = errors.New("friedolin: server unavailable")
	ErrNotExist                 = errors.New("friedolin: does not exist")
)

Functions

This section is empty.

Types

type Building

type Building struct {
	Id             BuildingId `json:"id"`
	Name           string     `json:"name"`
	ShortName      string     `json:"shortName"`
	AdditionalName string     `json:"additionalName"`

	Campus          string    `json:"campus,omitempty"`
	AcademyBuilding string    `json:"academyBuilding"`
	Location        *Location `json:"location"`

	Rooms []BuildingRoom `json:"rooms"`
}

type BuildingId

type BuildingId uint

type BuildingRoom

type BuildingRoom struct {
	Id             RoomId `json:"id"`
	Name           string `json:"name"`
	ShortName      string `json:"shortName"`
	AdditionalName string `json:"additionalName"`
}

type BuildingsBuilding

type BuildingsBuilding struct {
	Id   BuildingId `json:"id"`
	Name string     `json:"name"`
}

type Date

type Date struct {
	Day   uint8      `json:"day"`
	Month time.Month `json:"month"`
	Year  uint16     `json:"year"`
}

type DescriptionModule

type DescriptionModule struct {
	Id        ModuleId
	ShortText string
}

type Event

type Event struct {
	Id        EventId     `json:"id"`
	Type      EventType   `json:"type"`
	Number    uint32      `json:"number"`
	ShortText string      `json:"shortText"`
	Name      string      `json:"name"`
	Links     []EventLink `json:"links"`

	Content       *HTML `json:"content"`
	Literature    *HTML `json:"literature"`
	Comment       *HTML `json:"comment"`
	Prerequisites *HTML `json:"prerequisites"`

	Term        Term      `json:"term"`
	Cycle       TermCycle `json:"cycle"`
	WeeklyHours float32   `json:"weeklyHours"`
	Members1    uint16    `json:"members1"`
	Members2    uint16    `json:"members2"`
	Credits     *uint8    `json:"credits"`

	Groups      []Group           `json:"groups"`
	Modules     []EventModule     `json:"modules"`
	Instructors []EventInstructor `json:"instructors"`

	StructureTree StructureTree `json:"structureTree"`
}

type EventId

type EventId uint

type EventInstructor

type EventInstructor struct {
	Id             PersonId       `json:"id"`
	Name           string         `json:"name"`
	Responsibility Responsibility `json:"responsibility,omitempty"`
}
type EventLink struct {
	Title string `json:"title"`
	Link  string `json:"link"`
}

type EventModule

type EventModule struct {
	Id         ModuleId `json:"id"`
	ShortText  string   `json:"shortText"`
	Name       string   `json:"name"`
	ExamNumber uint32   `json:"examNumber"`
	UnitNumber uint32   `json:"unitNumber"`
}

type EventSearch

type EventSearch struct {
	Term   Term
	Number EventId
	Name   string
	Type   EventType

	Weekday  *time.Weekday
	FromTime *Time
	ToTime   *Time
}

type EventType

type EventType int16
const (
	TrainingCourse EventType = iota + 1
	Proseminar
	MainSeminar
	Exercise

	Colloquium
	AdvancedSeminar

	Project

	Propaedeutic
	SeminarExercise

	FieldExercise

	Tutorial
	Excursion

	TrainingResearchProject
	OptionalLecture
	OptionalSeminar

	Teleteaching
	Consulting
	Miscellaneous

	WorkingGroup

	RevisionCourse

	Workshop

	LectureExercise
	LectureSeminar

	BasicModule

	PracticalWorkSeminar

	LecturePracticalWork

	PracticeModule
	AdvancedModule

	LanguageCourse

	PracticalWork
)
const (
	Seminar EventType = 113

	Lecture     EventType = 236
	BlockCourse EventType = 247
)
const (
	Course EventType = 324 + iota

	CrosssectionalArea

	MovieScreening

	Exam
	Conference
	ConferenceSymposium
	MusicalEvent

	Meeting_
	Talk

	LectureSeries

	Session
	OtherEvent
	CelebrationFestivity
	Convention
	ExamTest
	ServiceTime
	Exhibition
	PracticalSemesterAccompanyingEvent
	Training
	Tutorial2
	Workshop2
	Tour
	Speech

	InformationSession
	Course2
	OnlineSeminar
	SeminarExcursion
	OnlineLecture
	BasicCourse
	Sample

	SummerSchool
	InauguralLecture

	Blockage

	Exercises

	Consultation EventType = -1
	RepeatExam   EventType = -2
)

func (EventType) MarshalText

func (e EventType) MarshalText() ([]byte, error)

type Frequency

type Frequency uint8
const (
	Once Frequency = iota
	Weekly
	Fortnightly
)

func (Frequency) MarshalText

func (f Frequency) MarshalText() ([]byte, error)

func (Frequency) String

func (f Frequency) String() string

type Fridolin

type Fridolin struct {
	Language string

	Session string
	Asi     string
}

func (*Fridolin) Building

func (f *Fridolin) Building(id BuildingId) (Building, error)

func (*Fridolin) Buildings

func (f *Fridolin) Buildings() ([]BuildingsBuilding, error)

func (*Fridolin) CertificateOfStudentStatus

func (f *Fridolin) CertificateOfStudentStatus(term Term) (io.ReadCloser, error)

func (*Fridolin) DataSheet

func (f *Fridolin) DataSheet() (io.ReadCloser, error)

func (*Fridolin) EvaluationOfStudyProgress

func (f *Fridolin) EvaluationOfStudyProgress() (io.ReadCloser, error)

func (*Fridolin) Event

func (f *Fridolin) Event(id EventId) (Event, error)

func (*Fridolin) Grades

func (f *Fridolin) Grades(degree uint8) ([]GradeSubject, error)

func (*Fridolin) Login

func (f *Fridolin) Login(username, password string) error

func (*Fridolin) Logout

func (f *Fridolin) Logout() error

func (*Fridolin) Module

func (f *Fridolin) Module(id ModuleId) (Module, error)

func (*Fridolin) ModuleDescriptions

func (f *Fridolin) ModuleDescriptions(degree uint8, courseOfStudies uint16, mark string, version uint16) ([]DescriptionModule, error)

func (*Fridolin) MyEvents

func (f *Fridolin) MyEvents() ([]MyEvent, error)

func (*Fridolin) MyInfo

func (f *Fridolin) MyInfo() (MyInfo, error)

func (*Fridolin) News

func (f *Fridolin) News() ([]News, error)

func (*Fridolin) PaymentInformation

func (f *Fridolin) PaymentInformation() (PaymentInformation, error)

func (*Fridolin) Room

func (f *Fridolin) Room(id RoomId) (Room, error)

func (*Fridolin) Schedule

func (f *Fridolin) Schedule() ([]ScheduleEvent, error)

func (*Fridolin) SearchEvents

func (f *Fridolin) SearchEvents(s EventSearch, count, offset uint) ([]SearchEvent, error)

type GradeEvent

type GradeEvent struct {
	Type   EventType `json:"type"`
	Number uint32    `json:"number"`
	Name   string    `json:"name"`

	Term Term `json:"term"`
}

type GradeExam

type GradeExam struct {
	Number uint32 `json:"number"`
	Term   Term   `json:"term"`

	Grade  float32     `json:"grade,omitempty"`
	Reason GradeReason `json:"reason"`
	Try    uint8       `json:"try"`

	ExamDate         *Date  `json:"examDate"`
	Examiner         string `json:"examiner"`
	AnnouncementDate Date   `json:"announcementDate"`

	Units []GradeUnit `json:"units"`
}

type GradeModule

type GradeModule struct {
	ShortText string `json:"shortText"`
	Name      string `json:"name"`
	Term      Term   `json:"term"`

	Grade   float32 `json:"grade,omitempty"`
	Credits uint8   `json:"credits"`

	Exams []GradeExam `json:"exams"`
}

type GradeReason

type GradeReason uint8
const (
	Absent GradeReason
	Ungraded
)

type GradeSubject

type GradeSubject struct {
	Modules []GradeModule `json:"modules"`
}

type GradeUnit

type GradeUnit struct {
	Number uint32 `json:"number"`
	Name   string `json:"name"`

	Events []GradeEvent `json:"events"`
}

type Group

type Group struct {
	Number   *uint8    `json:"number"`
	Meetings []Meeting `json:"meetings"`
}

type HTML

type HTML html.Node

func (*HTML) MarshalText

func (h *HTML) MarshalText() ([]byte, error)

func (*HTML) Render

func (h *HTML) Render() (string, error)

type Location

type Location struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

type Meeting

type Meeting struct {
	Type   EventType    `json:"type,omitempty"`
	Remark *HTML        `json:"remark"`
	Room   *MeetingRoom `json:"room"`
	Online bool         `json:"online"`
	State  MeetingState `json:"state,omitempty"`

	TimeOffset *uint8 `json:"timeOffset"`
	FromTime   *Time  `json:"fromTime"`
	ToTime     *Time  `json:"toTime"`

	Frequency Frequency    `json:"frequency"`
	Weekday   time.Weekday `json:"weekday"`
	FromDate  Date         `json:"fromDate"`
	ToDate    Date         `json:"toDate"`
}

type MeetingRoom

type MeetingRoom struct {
	Id           RoomId `json:"id"`
	Name         string `json:"name"`
	BuildingName string `json:"buildingName"`
}

type MeetingState

type MeetingState uint8
const (
	TakingPlace MeetingState
	Cancelled
)

func (MeetingState) MarshalText

func (r MeetingState) MarshalText() ([]byte, error)

func (MeetingState) String

func (s MeetingState) String() string

type Module

type Module struct {
	Id        ModuleId `json:"id"`
	Number    uint32   `json:"number"`
	Name      string   `json:"name"`
	ShortText string   `json:"shortText"`

	Credits         uint8     `json:"credits"`
	Cycle           TermCycle `json:"cycle"`
	WorkloadPrivate uint16    `json:"workloadPrivate"`
	WorkloadClass   uint16    `json:"workloadClass"`

	Content            *HTML `json:"content"`
	Literature         *HTML `json:"literature"`
	LearningObjectives *HTML `json:"learningObjectives"`
	ExamPrerequisites  *HTML `json:"examPrerequisites"`
}

func (Module) Workload

func (m Module) Workload() uint16

type ModuleId

type ModuleId uint

type ModuleRequirement

type ModuleRequirement struct {
	ShortText string `json:"shortText"`
	Name      string `json:"name"`
}

type MyEvent

type MyEvent struct {
	Id     EventId
	Number uint32
	Name   string
}

type MyInfo

type MyInfo struct {
	FirstName           string `json:"firstName"`
	LastName            string `json:"lastName"`
	Username            string `json:"username"`
	MatriculationNumber uint32 `json:"matriculationNumber"`
}

type News

type News struct {
	Date  Date   `json:"date"`
	Title string `json:"title"`
	Body  *HTML  `json:"body"`
}

type ObjectId

type ObjectId uint

type PaymentInformation

type PaymentInformation struct {
	Ticket           float32 `json:"ticket"`
	Studierendenwerk float32 `json:"studierendenwerk"`
	StudentCouncil   float32 `json:"studentCouncil"`

	Paid float32 `json:"paid"`
}

func (PaymentInformation) StillDue

func (p PaymentInformation) StillDue() float32

func (PaymentInformation) Total

func (p PaymentInformation) Total() float32

type PersonId

type PersonId uint

type Responsibility

type Responsibility uint8
const (
	Responsible Responsibility
	Accompanying
	Organizational
)

func (Responsibility) MarshalText

func (r Responsibility) MarshalText() ([]byte, error)

func (Responsibility) String

func (r Responsibility) String() string

type Room

type Room struct {
	Id             RoomId   `json:"id"`
	Type           RoomType `json:"type"`
	Name           string   `json:"name"`
	ShortName      string   `json:"shortName"`
	AdditionalName string   `json:"additionalName"`

	Building RoomBuilding `json:"building"`
	Images   []ObjectId   `json:"images"`
}

type RoomBuilding

type RoomBuilding struct {
	Id   BuildingId `json:"id"`
	Name string     `json:"name"`
}

type RoomId

type RoomId uint

type RoomType

type RoomType uint8
const (
	LectureHall RoomType = iota + 1
	SeminarRoom
	Lab
	ComputerLab
	ReadingRoom
	Gym

	DutyRoom
	MeetingRoom_
	OtherRoom

	OutdoorFacility
	SwimmingPool
	SportsRoom
	CourseRoom

	TreatmentRoom
	Divers
	Foyer
	MultimediaCenter
	EventRoom
)

func (RoomType) MarshalText

func (r RoomType) MarshalText() ([]byte, error)

type ScheduleEvent

type ScheduleEvent struct {
	Id     EventId   `json:"id"`
	Number uint32    `json:"number"`
	Type   EventType `json:"type"`
	Name   string    `json:"name"`

	Term Term `json:"term"`

	Groups []Group `json:"groups"`
}

type SearchEvent

type SearchEvent struct {
	Id     EventId
	Type   EventType
	Number uint32
	Name   string
}

type Season

type Season uint8
const (
	Summer Season = 1 + iota
	Winter
)

func (Season) MarshalText

func (s Season) MarshalText() ([]byte, error)

func (Season) String

func (s Season) String() string

type StructureTree

type StructureTree struct {
	Name     string          `json:"name"`
	Children []StructureTree `json:"children,omitempty"`
}

type Term

type Term struct {
	Year   uint16 `json:"year"`
	Season Season `json:"season"`
}

func ParseTerm

func ParseTerm(s string) (Term, error)

func (Term) After

func (t Term) After(t2 Term) bool

func (Term) Before

func (t Term) Before(t2 Term) bool

func (Term) Compare

func (t Term) Compare(u Term) int

type TermCycle

type TermCycle uint8

func (TermCycle) Contains

func (c TermCycle) Contains(s Season) bool

func (TermCycle) MarshalText

func (c TermCycle) MarshalText() ([]byte, error)

type Time

type Time struct {
	Hour   uint8 `json:"hour"`
	Minute uint8 `json:"minute"`
}

type UserError

type UserError struct {
	Message string
}

func (UserError) Error

func (e UserError) Error() string

Jump to

Keyboard shortcuts

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