user

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

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetUser(context.Context, GetUserRequest, GetUserGuard) (*getUserResponse, error)
	Register(context.Context, RegisterRequest) error
}

func NewService

func NewService(repo domain.UserRepo, logger logger.Logger, hasher hasher.Hasher) API

type GetUserGuard

type GetUserGuard interface {
	CanGetUser() bool
}

type GetUserRequest

type GetUserRequest struct {
	UserUUID string
}

GetUserRequest is a DTO that adapters have to pass to the port. This helps to keep all domain validation on the core, and non-adapter specific.

type RegisterRequest

type RegisterRequest struct {
	Email    string
	Password string
}

type UserService

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

func (*UserService) GetUser

func (us *UserService) GetUser(ctx context.Context, userDTO GetUserRequest, guard GetUserGuard) (*getUserResponse, error)

func (*UserService) Register

func (us *UserService) Register(ctx context.Context, in RegisterRequest) error

Jump to

Keyboard shortcuts

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