Back to

Package models

Latest Go to latest

The highest tagged major version is .

Published: Sep 29, 2019 | License: MIT | Module:


type Event

type Event struct {
	ID bson.ObjectId `json:"id" bson:"_id"`

	Subject     string `json:"subject" bson:"subject"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Mimos       bool   `json:"mimos" bson:"mimos"`

	Classroom int `json:"class_room" bson:"class_room"`
	Group     int `json:"group" bson:"group"`
	Promotion int `json:"promotion" bson:"promotion"`

	StartDate time.Time `json:"start" bson:"start"`
	EndDate   time.Time `json:"end" bson:"end"`
	AllDay    bool      `json:"allDay" bson:"all_day"`

	LastEditName string    `json:"last_edit_name" bson:"last_edit_name"`
	LastEditDate time.Time `json:"last_edit_date" bson:"last_edit_date"`

Event struct

func GetEvent

func GetEvent(id bson.ObjectId) (Event, error)

GetEvent returns specific event

func GetEvents

func GetEvents(promo int, classroom int, group int) ([]Event, error)

GetEvents returns all events

func (*Event) Delete

func (e *Event) Delete() error

Delete event

func (*Event) Save

func (e *Event) Save() error

Save event

type MicrosoftProfile

type MicrosoftProfile struct {
	DisplayName string `json:"displayName"`
	Mail        string `json:"mail"`

MicrosoftProfile struct

type User

type User struct {
	ID bson.ObjectId `json:"id" bson:"_id"`

	Name  string `json:"name" bson:"name"`
	Email string `json:"email" bson:"email"`

	Classroom int `json:"class_room" bson:"class_room"`
	Group     int `json:"group" bson:"group"`
	Promotion int `json:"promotion" bson:"promotion"`

	CreatedAt time.Time `json:"creation_at" bson:"creation_at"`

User structure

func FindUser

func FindUser(profile MicrosoftProfile) (User, error)

FindUser by microsoft email

func GetUser

func GetUser(id bson.ObjectId) (User, error)

GetUser returns specific user

func (*User) SaveSettings

func (u *User) SaveSettings(promo int, class int, group int) error

SaveSettings saves user's settings

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier