Documentation ¶
Overview ¶
Package user present full API functionality of the specific object
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
ComparePasswords between income password and generated hash
func PasswordHash ¶
PasswordHash process and return processed password to bcrypt hash
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 ListOrder ¶
type ListOrder struct { ID model.Order Email model.Order Status model.Order CreatedAt model.Order UpdatedAt model.Order }
ListOrder object with order values which is not NULL
type Repository ¶
type Repository interface { Get(ctx context.Context, id uint64) (*model.User, error) GetByEmail(ctx context.Context, email string) (*model.User, error) GetByPassword(ctx context.Context, email, password string) (*model.User, error) GetByToken(ctx context.Context, token string) (*model.User, *model.Account, error) FetchList(ctx context.Context, filter *ListFilter, order *ListOrder, page *repository.Pagination) ([]*model.User, error) Count(ctx context.Context, filter *ListFilter) (int64, error) Create(ctx context.Context, user *model.User, password string) (uint64, error) Update(ctx context.Context, user *model.User) error Delete(ctx context.Context, id uint64) error SetPassword(ctx context.Context, user *model.User, password string) error CreateResetPassword(ctx context.Context, userID uint64) (*model.UserPasswordReset, error) GetResetPassword(ctx context.Context, userID uint64, token string) (*model.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) (*model.User, error) GetByEmail(ctx context.Context, email string) (*model.User, error) GetByPassword(ctx context.Context, email, password string) (*model.User, error) GetByToken(ctx context.Context, token string) (*model.User, *model.Account, error) FetchList(ctx context.Context, filter *ListFilter, order *ListOrder, page *repository.Pagination) ([]*model.User, error) Count(ctx context.Context, filter *ListFilter) (int64, error) Store(ctx context.Context, user *model.User, password string) (uint64, error) Update(ctx context.Context, user *model.User) error Delete(ctx context.Context, id uint64) error SetPassword(ctx context.Context, user *model.User, password string) error ResetPassword(ctx context.Context, email string) (*model.UserPasswordReset, *model.User, error) UpdatePassword(ctx context.Context, token, email, password string) error }
Usecase describes basic user methods
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.