Documentation ¶
Index ¶
- Constants
- func Hash(s string) string
- func Paginate(currentPage int, pageSize int) func(db *gorm.DB) *gorm.DB
- type Highlight
- type HighlightRepository
- func (u *HighlightRepository) Highlight(userID int, documentPath string) error
- func (u *HighlightRepository) Highlighted(userID int, documents []search.Document) []search.Document
- func (u *HighlightRepository) Highlights(userID int, page int, resultsPerPage int) (search.PaginatedResult, error)
- func (u *HighlightRepository) Remove(userID int, documentPath string) error
- 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 HighlightRepository ¶ added in v3.8.0
func (*HighlightRepository) Highlight ¶ added in v3.8.0
func (u *HighlightRepository) Highlight(userID int, documentPath string) error
func (*HighlightRepository) Highlighted ¶ added in v3.8.0
func (*HighlightRepository) Highlights ¶ added in v3.8.0
func (u *HighlightRepository) Highlights(userID int, page int, resultsPerPage int) (search.PaginatedResult, error)
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 Highlights []Highlight }
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.