cesi

package
v0.0.0-...-b1d721b Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMissingCredentials = Error("missing credentials")
	ErrInitConnection     = Error("error while initializing connection")
)
View Source
const (
	BaseURL     = "https://ent.cesi.fr/"
	WayfBaseURL = "https://wayf.cesi.fr"
	CalendarURL = "https://ent.cesi.fr/api/seance/all?start=%s&end=%s&codePersonne=%d"
	ProfileURL  = "https://ent.cesi.fr/%s/emploi-du-temps/%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Calendar

type Calendar struct {
	Events []*Event
}

type Cesi

type Cesi struct {
	User *User
	// contains filtered or unexported fields
}

func New

func New(o *Options) *Cesi

func (*Cesi) Get

func (c *Cesi) Get(url string) (*http.Response, error)

func (*Cesi) GetCurrentUser

func (c *Cesi) GetCurrentUser() (*User, error)

func (*Cesi) Login

func (c *Cesi) Login() error

func (*Cesi) Post

func (c *Cesi) Post(url string, body io.Reader) (*http.Response, error)

func (*Cesi) PostForm

func (c *Cesi) PostForm(url string, data url.Values) (*http.Response, error)

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Establishment

type Establishment struct {
	Name string
}

type Event

type Event struct {
	Code      string      `json:"code"`
	Title     string      `json:"title"`
	AllDay    bool        `json:"allDay"`
	Nightly   bool        `json:"nightly"`
	Start     time.Time   `json:"start"`
	End       time.Time   `json:"end"`
	Url       string      `json:"url"`
	NomModule string      `json:"nomModule"`
	Matiere   interface{} `json:"matiere"`
	Theme     string      `json:"theme"`
	Salles    []struct {
		NomSalle string `json:"nomSalle"`
	} `json:"salles"`
	Intervenants []struct {
		SousTitre           interface{}   `json:"sousTitre"`
		Profils             interface{}   `json:"profils"`
		GroupesPedagogiques interface{}   `json:"groupesPedagogiques"`
		UrlFiche            string        `json:"urlFiche"`
		UrlPhoto            string        `json:"urlPhoto"`
		Nom                 string        `json:"nom"`
		Prenom              string        `json:"prenom"`
		Code                string        `json:"code"`
		AdresseMail         string        `json:"adresseMail"`
		UrlAgenda           string        `json:"urlAgenda"`
		Sessions            []interface{} `json:"sessions"`
		Inconnu             bool          `json:"inconnu"`
	} `json:"intervenants"`
	ParticipantsPersonne interface{} `json:"participantsPersonne"`
	Participants         []struct {
		LibelleGroupe string `json:"libelleGroupe"`
		CodeGroupe    string `json:"codeGroupe"`
		CodeSession   string `json:"codeSession"`
	} `json:"participants"`
}

func (*Event) UnmarshalJSON

func (ct *Event) UnmarshalJSON(b []byte) (err error)

type Options

type Options struct {
	Email     string
	Password  string
	UserAgent string
	Debug     bool
}

type SAMLRequestData

type SAMLRequestData struct {
	Action      string
	RelayState  string
	SAMLRequest string
}

type Session

type Session struct {
	ID string
}

type User

type User struct {
	ID             int
	FirstName      string
	LastName       string
	Email          string
	Phone          string
	Promotion      string
	Session        *Session
	Establishments []*Establishment
	// contains filtered or unexported fields
}

func (*User) GetCalendar

func (u *User) GetCalendar(start time.Time, end time.Time) (*Calendar, error)

func (*User) GetIdentifier

func (u *User) GetIdentifier() string

Jump to

Keyboard shortcuts

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