controllers

package
v0.0.0-...-10dc621 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIME = "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
)

Variables

View Source
var AdminCollection *mongo.Collection = database.OpenCollection(database.Client, "admins")
View Source
var ContactCollection *mongo.Collection = database.OpenCollection(database.Client, "contacts")
View Source
var ImageCollection *mongo.Collection = database.OpenCollection(database.Client, "images")
View Source
var LockerCollection *mongo.Collection = database.OpenCollection(database.Client, "lockers")
View Source
var SecretKey = os.Getenv("secret")
View Source
var StudentCollection *mongo.Collection = database.OpenCollection(database.Client, "students")
View Source
var TeacherCollection *mongo.Collection = database.OpenCollection(database.Client, "teachers")

Functions

func Admin

func Admin(c *fiber.Ctx) error

func AdminLogin

func AdminLogin(c *fiber.Ctx) error

func AuthenticateUser

func AuthenticateUser(c *fiber.Ctx, userType int) (bool, string)

func CreateAdmin

func CreateAdmin(c *fiber.Ctx) error

func CreateContact

func CreateContact(c *fiber.Ctx) error

func CreateDefaultAdmin

func CreateDefaultAdmin() models.Admin

func DeleteContact

func DeleteContact(c *fiber.Ctx) error

func Enroll

func Enroll(c *fiber.Ctx) error

func GenerateID

func GenerateID(length int) string

func Logout

func Logout(c *fiber.Ctx) error

Should work for both teacher and student ends

func NewSystem

func NewSystem()

func RegisterTeacher

func RegisterTeacher(c *fiber.Ctx) error

func RemoveAdmin

func RemoveAdmin(c *fiber.Ctx) error

func RemoveStudent

func RemoveStudent(c *fiber.Ctx) error

func RemoveTeacher

func RemoveTeacher(c *fiber.Ctx) error

func Student

func Student(c *fiber.Ctx) error

func StudentLogin

func StudentLogin(c *fiber.Ctx) error

func Teacher

func Teacher(c *fiber.Ctx) error

func TeacherLogin

func TeacherLogin(c *fiber.Ctx) error

func ValidateID

func ValidateID(id string, userType int) bool

func ValidatePEN

func ValidatePEN(pen string) bool

Types

type Config

type Config struct {
	Server   string
	Port     int
	Email    string
	Password string
}

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(to []string, subject string) *Request

func (*Request) Send

func (r *Request) Send(templateName string, items interface{}) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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