kordis

package
v0.0.0-...-946f586 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintAgenda

func PrintAgenda(agenda Agenda)

Types

type Agenda

type Agenda struct {
	ResponseCode int           `json:"response_code"`
	Version      string        `json:"version"`
	Result       []AgendaEvent `json:"result"`
	Links        []string      `json:"links"`
}

type AgendaEvent

type AgendaEvent struct {
	ReservationId         int        `json:"reservation_id"`
	Rooms                 []Room     `json:"rooms"`
	Type                  string     `json:"type"`
	Modality              string     `json:"modality"`
	Author                int        `json:"author"`
	CreateDate            int64      `json:"create_date"` // Unix timestamp milliseconds
	StartDate             int64      `json:"start_date"`  // Unix timestamp milliseconds
	EndDate               int64      `json:"end_date"`    // Unix timestamp milliseconds
	Comment               string     `json:"comment"`
	Classes               []string   `json:"classes"`
	Name                  string     `json:"name"`
	Discipline            Discipline `json:"discipline"`
	Teacher               string     `json:"teacher"`
	Promotion             string     `json:"promotion"`
	PrestationType        int        `json:"prestation_type"`
	IsElectronicSignature bool       `json:"is_electronic_signature"`
	Links                 []string   `json:"links"`
}

type Discipline

type Discipline struct {
	Coef             any      `json:"coef"`
	Ects             any      `json:"ects"`
	Name             string   `json:"name"`
	Teacher          string   `json:"teacher"`
	Trimester        string   `json:"trimester"`
	Year             int      `json:"year"`
	Links            []string `json:"links"`
	HasDocuments     any      `json:"has_documents"`
	HasGrades        any      `json:"has_grades"`
	NbStudents       int      `json:"nb_students"`
	RcId             int      `json:"rc_id"`
	SchoolId         int      `json:"school_id"`
	StudentGroupId   int      `json:"student_group_id"`
	StudentGroupName string   `json:"student_group_name"`
	SyllabusId       any      `json:"syllabus_id"`
	TeacherId        int      `json:"teacher_id"`
	TrimesterId      int      `json:"trimester_id"`
}

type KordisApi

type KordisApi struct {
	LastUpdatedTokenDate time.Time
	// contains filtered or unexported fields
}

func GetKordisApi

func GetKordisApi(config *conf.Config) *KordisApi

func GetMygesApi

func GetMygesApi(c *conf.Config) (*KordisApi, error)

func (*KordisApi) Get

func (mygesApi *KordisApi) Get(url string, queryParams map[string]string) (*resty.Response, error)

func (*KordisApi) GetAgenda

func (mygesApi *KordisApi) GetAgenda(start time.Time, end time.Time) (Agenda, error)

func (*KordisApi) GetAgendaFromNow

func (mygesApi *KordisApi) GetAgendaFromNow(days int) (Agenda, error)

type Room

type Room struct {
	Links     []string `json:"links"`
	RoomId    int      `json:"room_id"`
	Name      string   `json:"name"`
	Floor     string   `json:"floor"`
	Campus    string   `json:"campus"`
	Color     string   `json:"color"`
	Latitude  string   `json:"latitude"`
	Longitude string   `json:"longitude"`
}

Jump to

Keyboard shortcuts

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