users

package
v0.0.0-...-ce15a78 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 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       string `json:"id" pgx:"id"`
	Username string `json:"username" pgx:"username" binding:"required"`
	Email    string `json:"email" pgx:"email" binding:"required"`
}

type UserController

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

func NewUserController

func NewUserController(router *gin.RouterGroup, ur *UserRepo) UserController

func (*UserController) HandleCreateUser

func (uc *UserController) HandleCreateUser(c *gin.Context)

func (*UserController) HandleDeleteUser

func (uc *UserController) HandleDeleteUser(c *gin.Context)

func (*UserController) HandleGetUserById

func (uc *UserController) HandleGetUserById(c *gin.Context)

func (*UserController) HandleGetUsers

func (uc *UserController) HandleGetUsers(c *gin.Context)

func (*UserController) HandleUpdateUser

func (uc *UserController) HandleUpdateUser(c *gin.Context)

type UserRepo

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

func NewUserRepo

func NewUserRepo(conn *pgx.Conn) UserRepo

func (*UserRepo) CreateUser

func (r *UserRepo) CreateUser(user User) (User, error)

func (*UserRepo) DeleteUser

func (r *UserRepo) DeleteUser(id string) error

func (*UserRepo) GetUser

func (r *UserRepo) GetUser(id string) (User, bool)

func (*UserRepo) GetUsers

func (r *UserRepo) GetUsers() ([]User, error)

func (*UserRepo) UpdateUser

func (r *UserRepo) UpdateUser(id string, user User) (User, error)

Jump to

Keyboard shortcuts

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