api

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetScheduleGroups

func GetScheduleGroups(schedule []Day, startDate time.Time, endDate time.Time) error

func LazyCache

func LazyCache[T any](key string, t time.Duration, callback func() (T, error)) (T, bool, error)

func SortKeyValue

func SortKeyValue(entries []KeyValue)

Types

type Class

type Class struct {
	StudyTime  string `json:"study_time"`
	Begin      string `json:"study_time_begin"`
	End        string `json:"study_time_end"`
	Discipline string `json:"discipline"`
	Type       string `json:"study_type"`
	Cabinet    string `json:"cabinet"`
	WeekDay    string `json:"week_day"`
	FullDate   string `json:"full_date"`
	Employee   string `json:"employee"`
	Groups     string `json:"study_group"`
	Subgroup   string `json:"study_subgroup"`
}

type Day

type Day struct {
	MessageIds []int
	WeekDay    string
	Date       string
	Classes    []Class
}

func GetEmployeeSchedule

func GetEmployeeSchedule(employee KeyValue, startDate time.Time, endDate time.Time) ([]Day, error)

func GetSchedule

func GetSchedule(studyGroup string, startDate time.Time, endDate time.Time) ([]Day, error)

type EmployeesAndChairs

type EmployeesAndChairs struct {
	Employees []KeyValue `json:"employees"`
	Chairs    []KeyValue `json:"chairs"`
}

func GetAllEmployeesAndChairs

func GetAllEmployeesAndChairs() (EmployeesAndChairs, bool, error)

func GetEmployeesAndChairs

func GetEmployeesAndChairs(faculty string) (*EmployeesAndChairs, error)

type Entry

type Entry struct {
	Time  time.Time
	Value interface{}
	Err   error
}

type Filters

type Filters struct {
	Faculties      []KeyValue `json:"faculties"`
	EducationForms []KeyValue `json:"educForms"`
	Courses        []KeyValue `json:"courses"`
}

func GetFilters

func GetFilters() (Filters, error)

type Group

type Group struct {
	Faculty       KeyValue
	Course        KeyValue
	EducationForm KeyValue
	Group         KeyValue
}

func GetAllGroups

func GetAllGroups() ([]Group, bool, error)

type KeyValue

type KeyValue struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

func GetEmployeeByName

func GetEmployeeByName(name string) (KeyValue, bool, error)

func GetStudyGroups

func GetStudyGroups(faculty string, educationForm string, course string) ([]KeyValue, error)

Jump to

Keyboard shortcuts

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