usecase

package
v0.0.0-...-a8cf2a2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package usecase implements application business logic. Each logic group in own file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(repo UserRepo) *User

func (*User) CreateUser

func (u *User) CreateUser(ctx context.Context, user *entity.User) (int, error)

func (*User) GetUserByEmail

func (u *User) GetUserByEmail(ctx context.Context, email string) (*entity.User, error)

func (*User) Login

func (u *User) Login(ctx context.Context, email, password string) (*dto.LoginResponse, error)

func (*User) Register

func (u *User) Register(ctx context.Context, email, password string) error

func (*User) Users

func (u *User) Users(ctx context.Context) ([]*entity.User, error)

type UserRepo

type UserRepo interface {
	GetUsers(ctx context.Context) ([]*entity.User, error)
	GetUserByID(ctx context.Context, id string) (user *entity.User, err error)
	CreateUser(ctx context.Context, user *entity.User) (int, error)

	GetUserByEmail(ctx context.Context, email string) (*entity.User, error)
}

UserRepo

type UserUseCase

type UserUseCase interface {
	Users(ctx context.Context) ([]*entity.User, error)
	CreateUser(ctx context.Context, user *entity.User) (int, error)
	GetUserByEmail(ctx context.Context, id string) (*entity.User, error)

	Register(ctx context.Context, email, password string) error
	Login(ctx context.Context, email, password string) (*dto.LoginResponse, error)
}

User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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