scraper

package
v0.0.0-...-934cb64 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchedule

func GetSchedule(groupCode, date string, dataAccumulator *struct {
	groupName string
	weekType  string
	schedule  Schedule
}, attemptsNumber int) error

nolint: cyclop, funlen

Types

type Course

type Course struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

type Data

type Data struct {
	Faculties              []Faculty           `json:"faculties"`
	Courses                []Course            `json:"courses"`
	Groups                 []Group             `json:"groups"`
	Schedule               map[string]Schedule `json:"schedule"`
	GroupNames             map[string]string   `json:"group_names"`
	WeekType               string              `json:"week_type"`
	LastScheduleUpdateTime int64               `json:"last_schedule_update_time"`
	// contains filtered or unexported fields
}

func NewData

func NewData(log *logrus.Logger, m *metrics.Metrics) (*Data, error)

nolint: complexity, cyclop

func (*Data) GetBaseInfo

func (data *Data) GetBaseInfo() error

func (*Data) GetCourcesOfFacult

func (data *Data) GetCourcesOfFacult(faultyCode string) ([]Course, error)

func (*Data) GetCurrentWeek

func (data *Data) GetCurrentWeek() (string, error)

func (*Data) GetFaculties

func (data *Data) GetFaculties() ([]Faculty, error)

func (*Data) GetGroups

func (data *Data) GetGroups(faultyCode, course string) ([]Group, error)

func (*Data) GetLecturers

func (data *Data) GetLecturers() []string

func (*Data) GetScheduleForLecturer

func (data *Data) GetScheduleForLecturer(name string) (Schedule, error)

func (*Data) SaveToFile

func (data *Data) SaveToFile() error

nolint: gosec

func (*Data) StartScheduleUpdater

func (data *Data) StartScheduleUpdater()

func (*Data) UpdateSchedule

func (data *Data) UpdateSchedule() error

type Faculty

type Faculty struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

type Group

type Group struct {
	Code   string `json:"code"`
	FoCode string `json:"fo_code"`
}

type Lesson

type Lesson struct {
	Date      string `json:"date"` // Дата в формате ДД.ММ.ГГГГ
	Number    string `json:"number"`
	Title     string `json:"title"`
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
	Lecturer  string `json:"lecturer"`
	Type      string `json:"type"`
	Classroom string `json:"classroom"`
	Group     string `json:"group"`
}

type Schedule

type Schedule struct {
	Denominator [][]Lesson `json:"denominator"`
	Numerator   [][]Lesson `json:"numerator"`
}

Jump to

Keyboard shortcuts

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