Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTables ¶
func CreateTables(drop_if_exists bool)
CreateTables will AutoMigrate all tables in application. If drop_if_exists is set to true, it will drop all tables before creating.
func InitializeDB ¶
func InitializeDB()
IntializeDB reads all credentials in environments variable and creates a connection to the DB. It also creates a logs directory and a log file to save all errors in the application.
Types ¶
type DetailedRoom ¶
type User ¶
type User struct { gorm.Model Username *string `gorm:"unique;not null"` Password *string `gorm:"not null"` Role *string `gorm:"not null;check:role in ('member', 'mod', 'admin')"` Age *uint Gender *string `gorm:"check:gender in ('male', 'female', 'gay', 'les', 'other')"` Rooms []*Room `gorm:"many2many:detailed_rooms"` }
Click to show internal directories.
Click to hide internal directories.