domain

package
v0.0.0-...-8a49331 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID       string `json:"id,omitempty"`
	Email    string `db:"email"`
	Password string `db:"password"`
}

func (*User) ToUserResponse

func (user *User) ToUserResponse() UserResponse

type UserRepository

type UserRepository interface {
	GetAllUsers() ([]User, error)
}

type UserRepositoryLocal

type UserRepositoryLocal struct {
}

func NewUserRepositoryLocal

func NewUserRepositoryLocal() *UserRepositoryLocal

NewUserRepositoryLocal initializes a new instance of UserRepositoryLocal.

It takes a client parameter of type *sqlx.DB and returns an instance of UserRepository.

func (*UserRepositoryLocal) GetAllUsers

func (repo *UserRepositoryLocal) GetAllUsers() ([]User, error)

GetAllUsers returns all users from the local user repository.

It does not take any parameters. It returns a slice of UserResponse and an error.

type UserRequest

type UserRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func (*UserRequest) ToUser

func (request *UserRequest) ToUser() User

type UserResponse

type UserResponse struct {
	ID       string `json:"id"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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