Documentation
¶
Index ¶
- Variables
- func GetUserFieldMeta(fieldName string) admin.Meta
- func RegisterOTPToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterTeamToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterUserProfileToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterUserTeamToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterUserToAdmin(Admin *admin.Admin, config admin.Config)
- type OTP
- type Role
- type Team
- type TeamRole
- type TimeProviderConfig
- type User
- type UserProfile
- type UserTeam
Constants ¶
This section is empty.
Variables ¶
View Source
var TeamRoleValues = [...]string{
"Member",
"Manager",
"Admin",
}
TeamRoleValues ...
Functions ¶
func RegisterOTPToAdmin ¶
RegisterOTPToAdmin ...
func RegisterTeamToAdmin ¶
RegisterTeamToAdmin ...
func RegisterUserProfileToAdmin ¶
RegisterUserProfileToAdmin ...
func RegisterUserTeamToAdmin ¶
RegisterUserTeamToAdmin ...
Types ¶
type OTP ¶
type OTP struct {
Code string `gorm:"type:varchar(16);primary_key"`
ExpiryAt time.Time
User User
UserID uint `gorm:"unique"`
}
OTP ...
type Team ¶
type Team struct {
gorm.Model
Name string `gorm:"type:varchar(64);not null"`
Description string `gorm:"type:text"`
Active bool `gorm:"default:true; not null"`
TimeProviderName string `gorm:"not null"`
Users []User
}
Team represent a team/project comprising a set of user
type TimeProviderConfig ¶
type TimeProviderConfig struct {
Data interface{} `json:"data"`
Type string `json:"type"`
}
TimeProviderConfig ...
type User ¶
type User struct {
gorm.Model
Email string `gorm:"type:varchar(255); not null; unique_index"`
FirstName string `gorm:"type:varchar(30); not null"`
LastName string `gorm:"type:varchar(150)"`
Password []byte `gorm:"type:bytea"`
Active bool `gorm:"default:true; not null"`
TimeProviderConfig fields.JSONB `gorm:"type:jsonb; not null; default:'{}'::jsonb"`
IsAdmin bool `gorm:"default:false; not null"`
Teams []Team
Profiles []UserProfile
}
User represent the app user in system
type UserProfile ¶
type UserProfile struct {
gorm.Model
User User
UserID uint `gorm:"not null"`
Role Role
RoleID uint `gorm:"not null"`
Active bool `gorm:"default:false; not null"`
}
UserProfile associated to app users A user can have multiple profile, but only one of them could be active at any moment
Click to show internal directories.
Click to hide internal directories.