types

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Day

type Day struct {
	Lessons [8]Lesson `json:"lessons"`
}

Day represents the school day (the row in the schedule table) that contains eight Lessons.

type Duration

type Duration int

Duration represents the lesson's duration.

func (Duration) String

func (d Duration) String() string

type IncorrectDateError

type IncorrectDateError struct {
	Date string
}

IncorrectDateError is returned when the date does not match the "dd.mm" format or does not exist.

func (*IncorrectDateError) Error

func (e *IncorrectDateError) Error() string

IncorrectDateError implements Error method.

type IncorrectWeekNumberError

type IncorrectWeekNumberError struct {
	WeekNum int
}

IncorrectWeekNumberError is returned when the value of the school week number is out of the acceptable range.

func (*IncorrectWeekNumberError) Error

func (e *IncorrectWeekNumberError) Error() string

IncorrectWeekNumberError implements Error method.

type Lesson

type Lesson struct {
	SubLessons []SubLesson `json:"sub_lessons"`
}

Lesson represents the lesson (the cell in the schedule table) that can contain one or more SubLessons.

func (Lesson) GetGroupsTeacherLesson

func (l Lesson) GetGroupsTeacherLesson() string

func (Lesson) StringGroupLesson

func (l Lesson) StringGroupLesson() string

StringGroupLesson returns a string representation of Lesson based on the structure of the lesson display for groups.

func (Lesson) StringTeacherLesson

func (l Lesson) StringTeacherLesson() string

type LessonType

type LessonType int

LessonType is the type of the lesson. Can take 3 values: Lecture, Laboratory and Practice.

const (
	Lecture LessonType = iota
	Laboratory
	Practice
)

func (LessonType) String

func (lt LessonType) String() string

type LinkPointsToIncorrectObjectError

type LinkPointsToIncorrectObjectError struct {
	ObjectName        string
	ObjectNameFromURL string
}

LinkPointsToIncorrectObjectError is returned when when the schedule on the link does not match the expected schedule.

func (*LinkPointsToIncorrectObjectError) Error

LinkPointsToIncorrectObjectError implements Error method.

type Schedule

type Schedule struct {
	Weeks [2]Week `json:"weeks"`
}

Schedule represents the full schedule that contains two school Weeks.

func (Schedule) MarshalEasyJSON

func (v Schedule) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Schedule) UnmarshalEasyJSON

func (v *Schedule) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type StatusCodeError

type StatusCodeError struct {
	StatusCode int
	StatusText string
}

StatusCodeError is returned when a http.Get returns a response with a status code other than 200.

func (*StatusCodeError) Error

func (e *StatusCodeError) Error() string

StatusCodeError implements Error method.

type SubLesson

type SubLesson struct {
	Duration Duration   `json:"duration"`
	Type     LessonType `json:"type"`
	Group    string     `json:"group"`
	Name     string     `json:"name"`
	Teacher  string     `json:"teacher"`
	Room     string     `json:"room"`
}

SubLesson represents the nested lesson. During the time of one lesson, a group or teacher can have several SubLessons at the same time.

func (SubLesson) StringGroupSubLesson

func (sl SubLesson) StringGroupSubLesson() string

StringGroupSubLesson returns a string representation of SubLesson based on the structure of the lesson display for groups.

type UnavailableWeeklyScheduleError

type UnavailableWeeklyScheduleError struct {
	Object  string
	WeekNum int
}

UnavailableWeeklyScheduleError is returned when the weekly schedule is missing or not published.

func (*UnavailableWeeklyScheduleError) Error

UnavailableWeeklyScheduleError implements Error method.

type Week

type Week struct {
	Days [7]Day `json:"days"`
}

Week represents the school week (one of two schedule tables) that contains six Days (without Sunday).

Jump to

Keyboard shortcuts

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