usecase

package
v0.0.0-...-0a9cbe0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const AccessTokenTTL = 900
View Source
const RefreshTokenTTL = 1800

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 drivers.DataStore, cfg *config.Config, logger *logger.Logger) *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) GetUserByID

func (u *User) GetUserByID(ctx context.Context, id int) (*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 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)
	GetUserByID(ctx context.Context, id int) (*entity.User, error)

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

User

Jump to

Keyboard shortcuts

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