Documentation
¶
Index ¶
- Variables
- func CreateTokens(roles string, email string) (string, string, error)
- func DeleteValue(key string) error
- func GetTTL(key string) (int64, error)
- func GetValue(key string) (string, error)
- func InitRedis()
- func InitializeDatabase()
- func JWTAuthMiddleware() gin.HandlerFunc
- func SetValue(key string, value string, expiration time.Duration) error
- type Claims
- type Form
- type FormConfig
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
View Source
var (
Rdb *redis.Client
)
Functions ¶
func DeleteValue ¶
func InitializeDatabase ¶
func InitializeDatabase()
func JWTAuthMiddleware ¶
func JWTAuthMiddleware() gin.HandlerFunc
Types ¶
type FormConfig ¶
type FormConfig struct { ID uuid.UUID `gorm:"type:uuid;primaryKey;" json:"id"` UserEmail string `gorm:"type:varchar(100);not null;index;" json:"user_email"` AllowedDomains string `gorm:"type:text;not null" json:"allowed_domains"` CreatedAt time.Time `gorm:"autoCreateTime" json:"-"` UpdatedAt time.Time `gorm:"autoUpdateTime" json:"-"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` }
func (*FormConfig) BeforeCreate ¶
func (f *FormConfig) BeforeCreate(tx *gorm.DB) (err error)
type User ¶
type User struct { ID uuid.UUID `gorm:"type:text;primaryKey;" json:"id"` Name string `gorm:"type:varchar(100);not null" json:"name"` Email string `gorm:"type:varchar(100);unique;not null" json:"email"` Password string `gorm:"type:text;not null" json:"-"` Roles string `gorm:"type:text;not null;default:''" json:"-"` Status string `gorm:"type:text;not null;default:'active'" json:"-"` ProfilePicture *string `gorm:"type:text" json:"profile_picture,omitempty"` LastLoginAt *time.Time `gorm:"type:timestamp" json:"-"` CreatedAt time.Time `gorm:"autoCreateTime" json:"-"` UpdatedAt time.Time `gorm:"autoUpdateTime" json:"-"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` }
Click to show internal directories.
Click to hide internal directories.