users

package
v0.0.0-...-902682f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Id        int
	Name      string
	Username  string
	Password  string
	Email     string
	Address   string
	Status    string
	Token     string
	JWTToken  string
	Point     float64
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Repository

type Repository interface {
	Login(ctx context.Context, username string, password string) (Domain, error)
	Create(ctx context.Context, domain *Domain) (Domain, error)
	Update(ctx context.Context, domain Domain) (Domain, error)
	GetAll(ctx context.Context) ([]Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
	GetByToken(ctx context.Context, token string) (Domain, error)
	GetByUsername(ctx context.Context, username string) (Domain, error)
	GetByEmail(ctx context.Context, email string) (Domain, error)
	Delete(ctx context.Context, id int) error
}

type Usecase

type Usecase interface {
	Login(ctx context.Context, domain Domain) (Domain, error)
	Create(ctx context.Context, domain Domain) (Domain, error)
	Update(ctx context.Context, domain Domain, id int) (Domain, error)
	ResetPassword(ctx context.Context, password string, retypePassword string, id int) (Domain, error)
	GetAll(ctx context.Context) ([]Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
	GetByToken(ctx context.Context, token string) (Domain, error)
	ForgotPassword(ctx context.Context, email string) (Domain, error)
	Delete(ctx context.Context, id int) error
	Verify(ctx context.Context, domain Domain, id int) (Domain, error)
}

func NewUserUsecase

func NewUserUsecase(repo Repository, timeout time.Duration, configJWT middlewares.ConfigJWT) Usecase

type UserUsecase

type UserUsecase struct {
	Repo Repository

	ConfigJWT middlewares.ConfigJWT
	// contains filtered or unexported fields
}

func (*UserUsecase) Create

func (uc *UserUsecase) Create(ctx context.Context, domain Domain) (Domain, error)

func (*UserUsecase) Delete

func (uc *UserUsecase) Delete(ctx context.Context, id int) error

func (*UserUsecase) ForgotPassword

func (uc *UserUsecase) ForgotPassword(ctx context.Context, emails string) (Domain, error)

func (*UserUsecase) GetAll

func (uc *UserUsecase) GetAll(ctx context.Context) ([]Domain, error)

func (*UserUsecase) GetById

func (uc *UserUsecase) GetById(ctx context.Context, id int) (Domain, error)

func (*UserUsecase) GetByToken

func (uc *UserUsecase) GetByToken(ctx context.Context, token string) (Domain, error)

func (*UserUsecase) Login

func (uc *UserUsecase) Login(ctx context.Context, domain Domain) (Domain, error)

core bisinis login

func (*UserUsecase) ResetPassword

func (uc *UserUsecase) ResetPassword(ctx context.Context, password string, retypePassword string, id int) (Domain, error)

func (*UserUsecase) Update

func (uc *UserUsecase) Update(ctx context.Context, domain Domain, id int) (Domain, error)

func (*UserUsecase) Verify

func (uc *UserUsecase) Verify(ctx context.Context, domain Domain, id int) (Domain, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL