Documentation ¶
Index ¶
Constants ¶
View Source
const ( Mysql = "mysql" Postgres = "postgres" Sqlite3 = "sqlite3" Mssql = "mssql" )
Variables ¶
This section is empty.
Functions ¶
func MigrateDatabase ¶
func MigrateDatabase() func()
Configuration: Run migration scripts on the database
func UserActivation ¶
func UserActivation(on bool) func()
Configuration: Set the flag of user activation
Types ¶
type BaseModel ¶
type BaseModel struct { ID uuid.UUID `sql:"type:char(36);primary_key"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
Base model containing the common columns for all tables
type DBConfig ¶
type DBConfig struct { Driver string Username string Password string Host string Port string DBName string Path string InstanceConnectionName string }
The configuration for the database connection
type Token ¶
func Authenticate ¶
Authenticate the user by token
type User ¶
type User struct { BaseModel Name string `gorm:"not null"` Email string `gorm:"unique;not null"` Password string `gorm:"not null"` ActivationCode *string ResetPasswordCode *string ResetPasswordExpiredAt *time.Time Token string `gorm:"-"` }
func GetActivationCode ¶
Get user activation code by email
Click to show internal directories.
Click to hide internal directories.