package models import "time" type User struct { Id uint `gorm:"primaryKey" json:"id"` Name string `gorm:"column:user_name" json:"user"` Email string `gorm:"column:email" json:"email"` Role string `gorm:"column:role" json:"role,omitempty"` Password string `gorm:"column:password" json:"password"` Expiration *time.Time `gorm:"column:expiration" json:"expiration,omitempty"` Settings Settings `gorm:"type:json" json:"settings"` } func (u *User) IsValid() bool { return u.Name != "" }