Documentation ¶ Index ¶ Variables func InitDB(cfg Config) type Claims type Config type User Constants ¶ This section is empty. Variables ¶ View Source var DB *gorm.DB Global instance DB connection Functions ¶ func InitDB ¶ func InitDB(cfg Config) Initialize DB connection with PostgreSQL Types ¶ type Claims ¶ type Claims struct { Role string `json:"role"` jwt.StandardClaims } type Config ¶ type Config struct { Host string Port string User string Password string DBName string SSLMode string } type User ¶ type User struct { gorm.Model Name string `json:"name"` Email string `gorm:"unique" json:"email"` Password string `json:"password"` Role string `json:"role"` } Source Files ¶ View all Source files Claims.goUser.godbConn.go Click to show internal directories. Click to hide internal directories.