usecase

package
v0.0.0-...-4ac03a4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTokenType = "Bearer"

Variables

View Source
var ErrUserAlreadyExists = errors.New("user already exists")

Functions

This section is empty.

Types

type CreateUser

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

func NewCreateUserUseCase

func NewCreateUserUseCase(repository entity.UserRepository, uuidGeneratorFunc func() (uuid.UUID, error)) *CreateUser

func (*CreateUser) Execute

type CreateUserInputDto

type CreateUserInputDto struct {
	Document  string    `json:"cpf"`
	Name      string    `json:"nome"`
	BirthDate date.Date `json:"nascimento"`
	Email     string    `json:"email"`
	Password  string    `json:"senha"`
}

type CreatedUserOutputDto

type CreatedUserOutputDto struct {
	ID uuid.UUID `json:"id"`
	*CreateUserInputDto
}

type Login

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

func NewLoginUseCase

func NewLoginUseCase(repository entity.UserRepository, sessionRepository entity.SessionRepository, tokenSecretKey string, sessionDuration time.Duration) *Login

func (*Login) Execute

func (l *Login) Execute(ctx context.Context, input *LoginInputDto) (*LoginOutputDto, error)

type LoginInputDto

type LoginInputDto struct {
	Document string `json:"cpf"`
	Password string `json:"senha"`
}

type LoginOutputDto

type LoginOutputDto struct {
	Message string `json:"message"`
	Token   string `json:"token"`
	Type    string `json:"type"`
}

type SessionConfig

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

Jump to

Keyboard shortcuts

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