intra

package
v0.0.0-...-c8d34f3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EpitechTimeToRFC

func EpitechTimeToRFC(timeStr string) string

EpitechTimeToRFC allows to convert the Epitech Timestamp to RFC 3339

func GetModuleProjects

func GetModuleProjects(conf *parser.Config, module Module, chanProjects *chan []Activity, wg *sync.WaitGroup, client *http.Client)

GetModuleProjects retrieves the projects for every modules

func GetModules

func GetModules(conf *parser.Config, client *http.Client) (*[]Module, error)

GetModules retrieves registered modules of the user

func GetProjects

func GetProjects(config *parser.Config, projects *[]Activity) error

GetProjects fetches the list of all the projects the user is registered to goroutines are used in order to improve the performances. After waiting for every module information to be sent to the channel, the said channel is read until all projects are retrieved.

func GetRegisteredEvents

func GetRegisteredEvents(conf *parser.Config, listEvents *[]Event) error

GetRegisteredEvents fetches the list of events registered on a two month period starting from tomorrow.

Types

type Activities

type Activities struct {
	Activities []Activity `json:"activites"`
}

Activities is a struct containing an array of activies. Only there in order to match the intra output so that I can easily unmarshall to json

type Activity

type Activity struct {
	Title            string `json:"title"`
	Description      string `json:"description"`
	Begin            string `json:"begin"`
	End              string `json:"end"`
	TypeTitle        string `json:"type_title"`
	IsProject        bool   `json:"is_projet"`
	CodeActi         string `json:"codeacti"`
	Participants     []string
	ParticipantsName []string
	Update           bool   // for calendar update purposes. I know it's ugly to put it here. Sorry
	ID               string // for calendar update purposes. I know it's ugly to put it here. Sorry
}

Activity is a struct that contains useful information for every activity

type Event

type Event struct {
	CodeModule         string      `json:"codemodule"`
	CodeInstance       string      `json:"codeinstance"`
	CodeActi           string      `json:"codeacti"`
	CodeEvent          string      `json:"codeevent"`
	ModuleTitle        string      `json:"titlemodule"`
	ActiTitle          string      `json:"acti_title"`
	Start              string      `json:"start"`
	End                string      `json:"end"`
	IsRdv              string      `json:"is_rdv"`
	Room               Room        `json:"room"`
	RawEventRegistered interface{} `json:"event_registered"`
	EventRegistered    bool        `json:"-"`
	RdvGroupRegistered string      `json:"rdv_group_registered"`
	RdvIndivRegistered string      `json:"rdv_indiv_registered"`
}

Event is a json structure of the elements in the intra json response

type Member

type Member struct {
	Login string `json:"login"`
	Name  string `json:"title"`
}

Member is a struct that contains information about the member of the group

type Module

type Module struct {
	ID           int    `json:"id"`
	Semester     int    `json:"semester"`
	Scholaryear  int    `json:"scolaryear"`
	Code         string `json:"code"`
	Codeinstance string `json:"codeinstance"`
	Title        string `json:"title"`
	Registered   string `json:"status"`
}

Module is a structure that represents the intra Module

type Project

type Project struct {
	Title         string       `json:"title"`
	UserGroupName string       `json:"user_project_title"`
	Registered    []Registered `json:"registered"`
}

Project is a struct that contains information about the project

type Registered

type Registered struct {
	Title   string   `json:"title"`
	Master  Member   `json:"master"`
	Members []Member `json:"members"`
}

Registered is the list of groups

type Room

type Room struct {
	Code  string `json:"code"`
	Type  string `json:"type"`
	Seats int    `json:"seats"`
}

Room is a simple json object describing an epitech room field

Jump to

Keyboard shortcuts

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