Documentation ¶
Index ¶
- Variables
- func AutoMigrateDB()
- func GetRefreshCourses(w http.ResponseWriter, r *http.Request)
- func GetRefreshMajors(w http.ResponseWriter, r *http.Request)
- func InitDB()
- func PostRefreshCourses(w http.ResponseWriter, r *http.Request)
- func PostRefreshMajors(w http.ResponseWriter, r *http.Request)
- func ScrapeCoursesOfMajors(majors []Major)
- func ScrapeMajors()
- type Course
- type Lecture
- type Major
- type Post
- type Result
- type Schedule
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DBHost = os.Getenv("ITUSCHEDULER_POSTGRES_HOST") DBName = os.Getenv("ITUSCHEDULER_POSTGRES_NAME") DBUser = os.Getenv("ITUSCHEDULER_POSTGRES_USER") DBPassword = os.Getenv("ITUSCHEDULER_POSTGRES_PASSWORD") DBPort = os.Getenv("ITUSCHEDULER_POSTGRES_PORT") DBSSLMode = os.Getenv("ITUSCHEDULER_POSTGRES_SSLMODE") DB *gorm.DB //go:embed templates/* Templates embed.FS )
Functions ¶
func AutoMigrateDB ¶
func AutoMigrateDB()
func GetRefreshCourses ¶
func GetRefreshCourses(w http.ResponseWriter, r *http.Request)
func GetRefreshMajors ¶
func GetRefreshMajors(w http.ResponseWriter, r *http.Request)
func PostRefreshCourses ¶
func PostRefreshCourses(w http.ResponseWriter, r *http.Request)
func PostRefreshMajors ¶
func PostRefreshMajors(w http.ResponseWriter, r *http.Request)
func ScrapeCoursesOfMajors ¶
func ScrapeCoursesOfMajors(majors []Major)
func ScrapeMajors ¶
func ScrapeMajors()
Types ¶
type Course ¶
type Course struct { CRN string `gorm:"primarykey"` MajorCode string `gorm:"not null"` Major Major `gorm:"foreignKey:MajorCode;constraint:OnDelete:CASCADE"` Code string Catalogue string Title string TeachingMethod string Instructor string Lectures []Lecture Capacity int Enrolled int Reservation string MajorRestriction string Prerequisites string ClassRestriction string CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
type Lecture ¶
type Lecture struct { gorm.Model CourseCRN string `gorm:"uniqueIndex:idx_lecture;not null"` Course Course `gorm:"foreignKey:CourseCRN;constraint:OnDelete:CASCADE"` Building string Day string `gorm:"uniqueIndex:idx_lecture"` Time string `gorm:"uniqueIndex:idx_lecture"` TimeStart int TimeEnd int Room string }
type Schedule ¶
type User ¶
type User struct { gorm.Model Username string `gorm:"unique" validate:"required"` Email *string `gorm:"unique" validate:"required,email"` Password *string `validate:"required"` IsAdmin bool FacebookID *string `gorm:"unique"` TwitterID *string `gorm:"unique"` MajorCode *string Major Major `gorm:"foreignKey:MajorCode"` Courses []Course `gorm:"many2many:user_courses_go;"` Schedules []Schedule Sessions []Session }
Click to show internal directories.
Click to hide internal directories.