v1

package
v0.0.0-...-55ee965 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1 for interface UserRepository

Package v1 for endpoints with postgres

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserRepoPg

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

func NewUserRepositoryPg

func NewUserRepositoryPg(db *pgxpool.Pool, logger *slog.Logger) (*UserRepoPg, error)

func (UserRepoPg) CreateUser

func (u UserRepoPg) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser method for create new user @Summary Create user @Tags users @Description Create user @Param body body models.User true "body for user content" @Success 200 {object} models.IDInfo @Failure 400 @Failure 403 @Failure 500 @router /user [post]

func (UserRepoPg) DeleteUser

func (u UserRepoPg) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser method for delete user @Summary Delete user @Tags users @Description Delete user @Param id path string true "user ID" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [delete]

func (UserRepoPg) GetUserByID

func (u UserRepoPg) GetUserByID(w http.ResponseWriter, r *http.Request)

GetUserByID method for get user by id @Summary Get user by ID @Tags users @Description Get user by ID @Param id path string true "user ID" @Success 200 {object} models.User @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [get]

func (UserRepoPg) GetUsers

func (u UserRepoPg) GetUsers(w http.ResponseWriter, r *http.Request)

GetUsers method for get all users @Summary Get users @Tags users @Description Get users @Success 200 {object} models.Users @Failure 400 @Failure 403 @Failure 500 @router /user/list [get]

func (UserRepoPg) UpdateUser

func (u UserRepoPg) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser method for update user @Summary Update user @Tags users @Description Update user @Param id path string true "user ID" @Param body body models.User true "body for user content" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [put]

type UserRepoSqlite

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

func NewUserRepositorySqlite

func NewUserRepositorySqlite(db *sql.DB, logger *slog.Logger) (*UserRepoSqlite, error)

func (UserRepoSqlite) CreateUser

func (u UserRepoSqlite) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser method for create new user @Summary Create user @Tags users @Description Create user @Param body body models.User true "body for user content" @Success 200 {object} models.IDInfo @Failure 400 @Failure 403 @Failure 500 @router /user [post]

func (UserRepoSqlite) DeleteUser

func (u UserRepoSqlite) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser method for delete user @Summary Delete user @Tags users @Description Delete user @Param id path string true "user ID" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [delete]

func (UserRepoSqlite) GetUserByID

func (u UserRepoSqlite) GetUserByID(w http.ResponseWriter, r *http.Request)

GetUserByID method for get user by id @Summary Get user by ID @Tags users @Description Get user by ID @Param id path string true "user ID" @Success 200 {object} models.User @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [get]

func (UserRepoSqlite) GetUsers

func (u UserRepoSqlite) GetUsers(w http.ResponseWriter, r *http.Request)

GetUsers method for get all users @Summary Get users @Tags users @Description Get users @Success 200 {object} models.Users @Failure 400 @Failure 403 @Failure 500 @router /user/list [get]

func (UserRepoSqlite) UpdateUser

func (u UserRepoSqlite) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser method for update user @Summary Update user @Tags users @Description Update user @Param id path string true "user ID" @Param body body models.User true "body for user content" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [put]

type UserRepository

type UserRepository interface {
	CreateUser(w http.ResponseWriter, r *http.Request)
	GetUserByID(w http.ResponseWriter, r *http.Request)
	GetUsers(w http.ResponseWriter, r *http.Request)
	UpdateUser(w http.ResponseWriter, r *http.Request)
	DeleteUser(w http.ResponseWriter, r *http.Request)
}

Directories

Path Synopsis
Package mock_v1 is a generated GoMock package.
Package mock_v1 is a generated GoMock package.

Jump to

Keyboard shortcuts

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