Documentation ¶
Index ¶
- Constants
- func Hash(s string) string
- func Paginate(currentPage int, pageSize int) func(db *gorm.DB) *gorm.DB
- type User
- type UserRepository
- func (u *UserRepository) Admins() int64
- func (u *UserRepository) Create(user User) error
- func (u *UserRepository) Delete(uuid string) error
- func (u *UserRepository) FindByEmail(email string) (User, error)
- func (u *UserRepository) FindByRecoveryUuid(recoveryUuid string) (User, error)
- func (u *UserRepository) FindByUuid(uuid string) (User, error)
- func (u *UserRepository) List(page int, resultsPerPage int) ([]User, error)
- func (u *UserRepository) Total() int64
- func (u *UserRepository) Update(user User) error
Constants ¶
View Source
const ( ResultsPerPage = 10.0 )
View Source
const ( RoleRegular = iota + 1 RoleAdmin )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type User ¶
type User struct { gorm.Model Uuid string `gorm:"uniqueIndex"` Name string Email string `gorm:"uniqueIndex"` SendToEmail string Password string Role int WordsPerMinute float64 RecoveryUUID string RecoveryValidUntil time.Time }
func (User) ConfirmPassword ¶
type UserRepository ¶
func (*UserRepository) Admins ¶
func (u *UserRepository) Admins() int64
func (*UserRepository) Create ¶
func (u *UserRepository) Create(user User) error
func (*UserRepository) Delete ¶
func (u *UserRepository) Delete(uuid string) error
func (*UserRepository) FindByEmail ¶
func (u *UserRepository) FindByEmail(email string) (User, error)
func (*UserRepository) FindByRecoveryUuid ¶
func (u *UserRepository) FindByRecoveryUuid(recoveryUuid string) (User, error)
func (*UserRepository) FindByUuid ¶
func (u *UserRepository) FindByUuid(uuid string) (User, error)
func (*UserRepository) List ¶
func (u *UserRepository) List(page int, resultsPerPage int) ([]User, error)
func (*UserRepository) Total ¶
func (u *UserRepository) Total() int64
func (*UserRepository) Update ¶
func (u *UserRepository) Update(user User) error
Click to show internal directories.
Click to hide internal directories.