usecase

package
v0.0.0-...-51ef577 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package usecase is a layer responsible for driving the workflow of the application, matching the use cases at hand. These operations are interface-independent and can be both synchronous or message-driven. This layer is well suited for spanning transactions, high-level logging and security. The application layer is thin in terms of domain logic it merely coordinates the domain layer objects to perform the actual work.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmailAlreadyInUse is when given email is already in use.
	ErrEmailAlreadyInUse = apperror.NewBadRequest("email address is already in use")
)

Functions

This section is empty.

Types

type CreateUserDTO

type CreateUserDTO struct {
	Email    user.EmailAddress `json:"email,omitempty"`
	Password user.Password     `json:"password,omitempty"`
}

CreateUserDTO defines data required for creating an user.

func NewCreateUserDTO

func NewCreateUserDTO(email user.EmailAddress, password user.Password) *CreateUserDTO

NewCreateUserDTO creates a CreateUserDTO.

func (CreateUserDTO) Validate

func (c CreateUserDTO) Validate() (err *apperror.AppError)

Validate checks if the DTO has valid data

type CreateUserUseCase

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

CreateUserUseCase implements the logic for creatring an User.

func NewCreateUserUseCase

func NewCreateUserUseCase(repo user.Repository) CreateUserUseCase

NewCreateUserUseCase creates a new Create User use case.

func (CreateUserUseCase) Execute

Jump to

Keyboard shortcuts

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