Documentation
¶
Index ¶
- Constants
- type Assignment
- type AuthenticateObject
- type Client
- func (c *Client) GetGrid() (g *Grid, err error)
- func (c *Client) GetPosts()
- func (c *Client) GetSchedule(stream uint) (s *Schedule, err error)
- func (c *Client) GetStudies(stream uint) (st []Study, err error)
- func (c *Client) GetTasks()
- func (c *Client) Post(path string, data interface{}) (resp *resty.Response, err error)
- type Day
- type File
- type Grid
- type Position
- type Post
- type Schedule
- type ScheduleEntry
- type ScheduleMeta
- type Stream
- type Study
- type Task
- type Tasks
Constants ¶
View Source
const Endpoint = "https://bki.forlabs.ru"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct { ID int `json:"id"` TaskID int `json:"task_id"` Status int `json:"status"` //Choice //Variant //Options LastRepliedAt string `json:"last_replied_at"` AssignmentCredits int `json:"assignment_credits"` AssignmentDate string `json:"assignment_date"` AssessmentLecturerID int `json:"assessment_lecturer_id"` ResponsesCount int `json:"responses_count"` }
type AuthenticateObject ¶
type Client ¶
type Client struct { // Credentials are stored for re-authentication in case token expires Username string Password string // Tokens are changing after each request, so they are stored with a mutex TokenMutex sync.Mutex CurrentToken string XSRFToken string HTTPClient *resty.Client }
func Authenticate ¶
Authenticate method performs a request to https://bki.forlabs.ru/app/login and if successful, returns Client instance https://bki.forlabs.ru/app/login JSON username,password
func (*Client) GetSchedule ¶
/lm-vendor/repositories/sched/get_schedule
type File ¶
type File struct { ID int `json:"id"` Type string `json:"type"` Status int `json:"status"` Disk string `json:"disk"` Directory *string `json:"directory"` UUID string `json:"uuid"` Filename string `json:"filename"` Description *string `json:"description"` MimeType string `json:"mime_type"` Size int `json:"size"` Width int `json:"width"` Height int `json:"height"` Sort int `json:"sort"` CreatedAt string `json:"created_at"` URL string `json:"url"` //Preview //Thumbnail HumanSize string `json:"human_size"` }
type Grid ¶
type Grid struct { Days struct { Mon Day `json:"mon"` Tue Day `json:"tue"` Wed Day `json:"wed"` Thu Day `json:"thu"` Fri Day `json:"fri"` Sat Day `json:"sat"` Sun Day `json:"sun"` } `json:"days"` Positions []Position `json:"positions"` LessonName string `json:"lesson_name"` Type int `json:"type"` Week int `json:"upperweek"` }
encapsulated into grid
type Post ¶
type Post struct { ID int `json:"id"` StudyID int `json:"study_id"` Title string `json:"title"` Content string `json:"content"` // 2020-10-26T00:48:32.000000Z UpdatedAt string `json:"updated_at"` CreatedAt string `json:"created_at"` Attachments string `json:"attachments"` User struct { Name string `json:"name"` } `json:"user"` }
encapsulated into posts
type Schedule ¶
type Schedule struct { Meta ScheduleMeta `json:"meta"` Streams []Stream `json:"streams"` Entries []ScheduleEntry `json:"entries"` }
type ScheduleEntry ¶
type ScheduleEntry struct { Day int `json:"day"` Position int `json:"position"` Type int `json:"type"` // 1 - practice, 2 - lecture RoomName string `json:"room_name"` LecturerName string `json:"lecturer_name"` StudyID int `json:"study_id"` StudyName string `json:"study_name"` Subgroup string `json:"subgroup"` Streams []Stream `json:"streams"` }
type ScheduleMeta ¶
type Task ¶
type Task struct { ID int `json:"id"` Name string `json:"name"` Content string `json:"content"` Type int `json:"type"` CourseID *int `json:"course_id"` ChapterID *int `json:"chapter_id"` ChapterTitle *int `json:"chapter_title"` ChapterHasContent bool `json:"chapter_has_content"` Level int `json:"level"` Files []File `json:"files"` PivotStatus int `json:"pivot_status"` PivotCost int `json:"pivot_cost"` PivotSort int `json:"pivot_sort"` PivotType int `json:"pivot_type"` PivotStartAt *string `json:"pivot_start_at"` PivotEndAt *string `json:"pivot_end_at"` PivotDescription *string `json:"pivot_description"` }
type Tasks ¶
type Tasks struct { Assignments []Assignment `json:"assignments"` Tasks []Task `json:"tasks"` }
Click to show internal directories.
Click to hide internal directories.