app

package
v0.0.0-...-4ac0cf4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GreetHandler

func GreetHandler(c *fiber.Ctx) error

func Start

func Start()

Start initializes the application and starts the server.

It loads the configuration from the .env file and sets up the database connection. Then it creates the necessary repository and application instances. Finally, it defines the API routes and starts the server.

Types

type UserController

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

func (*UserController) DeleteUserByID

func (controller *UserController) DeleteUserByID(c *fiber.Ctx) error

DeleteUserByID deletes a user by their ID.

c is a pointer to a fiber.Ctx object that represents the HTTP request context. It is used to handle the response and any potential errors.

The function returns an error if there is an issue deleting the user. Otherwise, it returns the deleted user as a JSON response.

func (*UserController) FindUserByID

func (controller *UserController) FindUserByID(c *fiber.Ctx) error

FindUserByID retrieves a user by their ID.

c is a pointer to a fiber.Ctx object that represents the HTTP request context. It is used to handle the response and any potential errors.

The function returns an error if there is an issue retrieving the user. Otherwise, it returns the retrieved user as a JSON response.

func (*UserController) GetAllUsers

func (controller *UserController) GetAllUsers(c *fiber.Ctx) error

GetAllUsers retrieves all users from the UserController.

c is a pointer to a fiber.Ctx object that represents the HTTP request context. It is used to handle the response and any potential errors.

The function returns an error if there is an issue retrieving the users. Otherwise, it returns the retrieved users as a JSON response.

func (*UserController) UpdateUserByID

func (controller *UserController) UpdateUserByID(c *fiber.Ctx) error

UpdateUserByID updates a user by their ID.

c is a pointer to a fiber.Ctx object that represents the HTTP request context. It is used to handle the response and any potential errors.

The function returns an error if there is an issue updating the user. Otherwise, it returns the updated user as a JSON response.

Jump to

Keyboard shortcuts

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