user

package
v0.0.0-...-31d7e5f Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(e *echo.Echo, db *sql.DB)

Types

type UserController

type UserController struct{}

func (*UserController) Create

func (a *UserController) Create(c echo.Context, db *sql.DB) error

func (*UserController) Delete

func (u *UserController) Delete(c echo.Context, db *sql.DB) error

func (*UserController) Login

func (a *UserController) Login(c echo.Context, db *sql.DB) error

func (*UserController) Update

func (u *UserController) Update(c echo.Context, db *sql.DB) error

type UserModel

type UserModel struct {
	UserID   int    `json:"user_id"`
	Username string `json:"username"`
	Password string `json:"password"`
	UserType string `json:"user_type"`
}

type UserRepository

type UserRepository interface {
	Login(user *UserModel, db *sql.DB) (string, error)
	Create(user *UserModel, db *sql.DB) error
	Update(user *UserModel, userID int, db *sql.DB) error
	Delete(userID int, db *sql.DB) error
}

type UserService

type UserService struct{}

func (*UserService) Create

func (s *UserService) Create(user *UserModel, db *sql.DB) error

func (*UserService) Delete

func (s *UserService) Delete(userID int, db *sql.DB) error

func (*UserService) Login

func (s *UserService) Login(auth *UserModel, db *sql.DB) (string, error)

func (*UserService) Update

func (s *UserService) Update(user *UserModel, userID int, db *sql.DB) error

Jump to

Keyboard shortcuts

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