user

package
v0.0.0-...-c398d5f Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 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 User

type User struct {
	ID         int       `json:"id"`
	FirstName  string    `json:"first_name"`
	LastName   string    `json:"last_name"`
	Email      string    `json:"email"`
	Password   string    `json:"password"`
	CreatedAt  time.Time `json:"created_at"`
	ModifiedAt time.Time `json:"modified_at"`
}

User представляє структуру користувача

type UserService

type UserService struct {
	DB *sql.DB
}

UserService надає методи для роботи з користувачами

func (*UserService) CreateUser

func (s *UserService) CreateUser(w http.ResponseWriter, r *http.Request)

Create

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser видаляє користувача за ID

func (*UserService) GetUser

func (s *UserService) GetUser(w http.ResponseWriter, r *http.Request)

GetUser повертає інформацію про конкретного користувача за ID

func (*UserService) GetUsers

func (s *UserService) GetUsers(w http.ResponseWriter, r *http.Request)

GetUsers повертає список усіх користувачів з пагінацією

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser

Jump to

Keyboard shortcuts

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