Documentation ¶
Overview ¶
Package dnevnik76 doc
Package dnevnik76 parser ¶
Package dnevnik76 model
Index ¶
- Variables
- type Client
- func (cli *Client) GetCourses() (courses []Course, err error)
- func (cli *Client) GetCurrentQuarter() (result string)
- func (cli *Client) GetHomework() (hws []Homework, err error)
- func (cli *Client) GetMarksCurrent() (marks []Mark, err error)
- func (cli *Client) GetMarksFinal() (marks []Mark, err error)
- func (cli *Client) GetMarksFor(p string) (marks []Mark, err error)
- func (cli *Client) GetMarksForWithType(p string, t MarksListType) (marks []Mark, err error)
- func (cli *Client) GetMarksPeriods() (periods []Lperiod, err error)
- func (cli *Client) GetMessage(msgID int64) (m Message, err error)
- func (cli *Client) GetMessages() (messages []Message, err error)
- func (cli *Client) GetMessagesCount() (unread int, total int, err error)
- func (cli *Client) GetTeachers() (teachers []Teacher, err error)
- func (cli *Client) Login() (err error)
- func (cli *Client) PrintCookies()
- func (cli *Client) SetCookie(name, value string)
- func (cli *Client) ToJSON(o interface{}) (result string)
- type Course
- type CurrentInfo
- type Homework
- type Lperiod
- type Mark
- type MarkRange
- type MarksByDate
- type MarksListType
- type Message
- type Region
- type Schedule
- type School
- type Teacher
Constants ¶
This section is empty.
Variables ¶
var ( // DEBUG output DEBUG bool )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Username string `json:"login"` Password string `json:"password"` RegionID int64 `json:"region_id"` SchoolID int64 `json:"schoolId" xorm:"'school_id'"` Token string `json:"token"` CurrentInfo CurrentInfo `xorm:"-"` // contains filtered or unexported fields }
Client struct
func NewClient ¶
func NewClient(login string, password string, regionID int64, schoolID int64, httpClient *http.Client) *Client
NewClient create new client
func (*Client) GetCourses ¶
GetCourses to get subjects
func (*Client) GetCurrentQuarter ¶ added in v0.1.3
func (*Client) GetHomework ¶
GetHomework to get user homework
func (*Client) GetMarksCurrent ¶
GetMarksCurrent to get marks for current month
func (*Client) GetMarksFinal ¶
GetMarksFinal to get final marks
func (*Client) GetMarksFor ¶ added in v0.1.1
GetMarksFor to get marks for specific month
func (*Client) GetMarksForWithType ¶ added in v0.1.1
func (cli *Client) GetMarksForWithType(p string, t MarksListType) (marks []Mark, err error)
GetMarksForWithType to get user marks
func (*Client) GetMarksPeriods ¶
GetMarksPeriods to get marks periods
func (*Client) GetMessage ¶
GetMessage by id
func (*Client) GetMessages ¶
GetMessages list for current user
func (*Client) GetMessagesCount ¶
GetMessagesCount get current user messages count
func (*Client) GetTeachers ¶
GetTeachers to get class teachers
func (*Client) PrintCookies ¶
func (cli *Client) PrintCookies()
PrintCookies to print client cookies
type CurrentInfo ¶
type CurrentInfo struct { //PersonID int64 `json:"personId" xorm:"'person_id'"` RegionID int64 `json:"regionId" xorm:"'region_id'"` SchoolID int64 `json:"schoolId" xorm:"'school_id'"` SchoolName string `json:"schoolName"` ClassID int64 `json:"clsId" xorm:"'class_id'"` Class string `json:"cls"` EduYearStart int `json:"eduYearStart"` EduYearEnd int `json:"eduYearEnd"` }
CurrentInfo struct
type Homework ¶
type Homework struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` SchoolID int64 `json:"schoolId" xorm:"'school_id'"` ClassID int64 `json:"classId" xorm:"'class_id'"` Date time.Time `json:"date"` DayOfWeek string `json:"dow"` CourseID int64 `json:"courseId" xorm:"'course_id'"` CourseName string `json:"courseName"` Homework string `json:"homework"` Subject string `json:"subject"` }
Homework struct
type Lperiod ¶
type Lperiod struct { SchoolID int64 `json:"schoolId" xorm:"'school_id'"` SYear int `json:"start_year"` EYear int `json:"end_year"` Name string `json:"name"` Period string `json:"period"` Start time.Time `json:"start"` End time.Time `json:"end"` }
Lperiod struct
type Mark ¶
type Mark struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` UserID string `json:"userId" xorm:"'user_id'"` SchoolID int64 `json:"school_id" xorm:"'school_id'"` CourseID int64 `json:"course_id" xorm:"'course_id'"` CourseName string `json:"courseName"` Subject string `json:"subject"` HomeWork string `json:"homework"` Grade []int8 `json:"grades"` DayOfWeek string `json:"dow"` Date time.Time `json:"date"` SYear int `json:"s_year" xorm:"SMALLINT null"` EYear int `json:"e_year" xorm:"SMALLINT null"` Quarter int `json:"quarter" xorm:"SMALLINT null"` Annual bool `json:"annual" xorm:"null"` }
Mark struct
type MarkRange ¶
type MarkRange int
MarkRange in month
const ( // Month9 is September Month9 MarkRange = iota // Month10 is October Month10 // Month11 is November Month11 // Month12 is December Month12 // Month1 is January Month1 // Month2 is Febrary Month2 // Month3 is March Month3 // Month4 is April Month4 // Month5 is May Month5 // Month6 is June Month6 // Month7 is July Month7 // Month8 is August Month8 )
type MarksByDate ¶ added in v0.1.1
type MarksByDate []Mark
func (MarksByDate) Len ¶ added in v0.1.1
func (a MarksByDate) Len() int
func (MarksByDate) Less ¶ added in v0.1.1
func (a MarksByDate) Less(i, j int) bool
func (MarksByDate) Swap ¶ added in v0.1.1
func (a MarksByDate) Swap(i, j int)
type MarksListType ¶
type MarksListType int
MarksListType type
const ( // Note type Note MarksListType = iota // List type List // Date type Date )
func (MarksListType) String ¶
func (s MarksListType) String() string
type Message ¶
type Message struct { ID int64 `json:"id" xorm:"pk 'id'"` UserID string `json:"userId" xorm:"'user_id'"` Date time.Time `json:"date"` From string `json:"from"` IsUnread bool `json:"isUnread"` Subject string `json:"subject"` Body string `json:"body"` }
Message struct
type Schedule ¶
type Schedule struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` SchoolID int64 `json:"schoolId" xorm:"'school_id'"` StudentID int64 `json:"studentId" xorm:"'student_id'"` CourseID int64 `json:"courseId" xorm:"'course_id'"` Subject string `json:"subject"` Homework string `json:"homework"` Marks []int8 `json:"marks"` Date time.Time `json:"date"` }
Schedule struct
type School ¶
type School struct { ID int64 `json:"id" xorm:"pk 'id'"` RegionID int64 `json:"regionId" xorm:"'region_id'"` Name string `json:"name"` Type string `json:"type"` }
School struct
func GetSchools ¶
GetSchools for selected region
type Teacher ¶
type Teacher struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` UserID string `json:"userId" xorm:"'user_id'"` SchoolID int64 `json:"schoolId" xorm:"'school_id'"` FullName string `json:"fullName"` CourseID string `json:"courseId" xorm:"'course_id'"` CourseName string `json:"courseName"` }
Teacher struct