Documentation
¶
Overview ¶
Package user present full API functionality of the specific object
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Anonymous = User{ID: 0}
Anonymous user object
Functions ¶
This section is empty.
Types ¶
type ListFilter ¶
ListFilter object with filtered values which is not NULL
func (*ListFilter) PrepareQuery ¶
func (fl *ListFilter) PrepareQuery(q *gorm.DB) *gorm.DB
PrepareQuery returns the query with applied filters
type ListOptions ¶ added in v0.4.0
type ListOptions = repository.ListOptions
ListOptions is the list options struct
type Pagination ¶ added in v0.4.0
type Pagination = repository.Pagination
Pagination is the pagination object
type QOption ¶ added in v0.4.0
type QOption = repository.QOption
QOption is the query option interface
type Repository ¶
type Repository interface {
Get(ctx context.Context, id uint64) (*User, error)
GetByEmail(ctx context.Context, email string) (*User, error)
GetByPassword(ctx context.Context, email, password string) (*User, error)
FetchList(ctx context.Context, opts ...QOption) ([]*User, error)
Count(ctx context.Context, opts ...QOption) (int64, error)
Create(ctx context.Context, user *User, password string) (uint64, error)
Update(ctx context.Context, user *User) error
Delete(ctx context.Context, id uint64) error
SetPassword(ctx context.Context, user *User, password string) error
CreateResetPassword(ctx context.Context, userID uint64) (*UserPasswordReset, error)
GetResetPassword(ctx context.Context, userID uint64, token string) (*UserPasswordReset, error)
EliminateResetPassword(ctx context.Context, userID uint64) error
}
Repository describes basic user methods
type Usecase ¶
type Usecase interface {
Get(ctx context.Context, id uint64) (*User, error)
GetByEmail(ctx context.Context, email string) (*User, error)
GetByPassword(ctx context.Context, email, password string) (*User, error)
FetchList(ctx context.Context, opts ...QOption) ([]*User, error)
Count(ctx context.Context, opts ...QOption) (int64, error)
Create(ctx context.Context, user *User, password string) (uint64, error)
Update(ctx context.Context, user *User) error
Delete(ctx context.Context, id uint64) error
SetPassword(ctx context.Context, user *User, password string) error
ResetPassword(ctx context.Context, email string) (*UserPasswordReset, *User, error)
UpdatePassword(ctx context.Context, token, email, password string) error
}
Usecase describes basic user methods
type UserPasswordReset ¶ added in v0.4.0
type UserPasswordReset = models.UserPasswordReset
UserPasswordReset is the model for password reset tokens
Directories
¶
| Path | Synopsis |
|---|---|
|
delivery
|
|
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
Package repository implements methods of working with the repository objects
|
Package repository implements methods of working with the repository objects |
|
Package usecase user managing
|
Package usecase user managing |
Click to show internal directories.
Click to hide internal directories.