Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Subjects = map[string]Subject{
"MATHÉMATIQUES": {Name: "Mathématiques", Emoji: "🔢"},
"PHYSIQUE": {Name: "Sciences physiques", Emoji: "🔭"},
"INFO COURS": {Name: "Informatique", Emoji: "💻"},
"INFO TP": {Name: "Informatique (TP)", Emoji: "🖥"},
"FRANÇAIS PHILO": {Name: "Français/Philo", Emoji: "✒"},
"ANGLAIS": {Name: "Anglais", Emoji: "🍵"},
"ESPAGNOL": {Name: "Espagnol", Emoji: "🌮"},
"SCIENCES INGÉNIEUR": {Name: "Sciences de l'ingénieur", Emoji: "⚙"},
"SC ING TD": {Name: "Sciences de l'ingénieur (TD)", Emoji: "⚙"},
"DEVOIRS": {Name: "Devoir surveillé", Emoji: "✏"},
}
Subjects holds the list of all available subjects in Pronote
Functions ¶
func Login ¶
func Login(cache *redis.Client) error
Login uses user's credentials to get an API token
func ParseGraphQL ¶
ParseGraphQL transforms a full-text GraphQL query into a json query containing it
Types ¶
type Content ¶
type Content struct { Subject string Teachers string Time int `json:"from"` Contents []ContentPart }
Content stores the content of a passed lesson
type ContentPart ¶
ContentPart stores the different parts of a lesson
type Data ¶
type Data struct { // Homework to do for the next days Homeworks []Homework // Lessons during the next days Timetable []Lesson // Lesson contents written for the passed days Contents Contents }
Data stores possible data from the Pronote API
func GetContents ¶
GetContents fetches lesson contents for the past 5 days
func GetHomework ¶
GetHomework fetches the homework to do for the next 15 days
type Homework ¶
type Homework struct { Description string Subject string Due int `json:"for"` Done bool Files []File }
Homework defines the homework given for the next days by a teacher
type Lesson ¶
type Lesson struct { From int To int Subject string Teacher string Room string Status string Cancelled bool `json:"isCancelled"` Remote bool `json:"remoteLesson"` }
Lesson represents a class during a day on a specific subject
type Response ¶
type Response struct { // A list of errors that could occur during the request Errors []interface{} // The message associated to an error Message string // User token (if requested) Token string // Request data (if requested) Data Data }
Response holds the data from Pronote
func MakeRequest ¶
MakeRequest executes a GraphQL query to the Pronote API