crud-go-gin-redis-gorm-testify-docker

command module
v0.0.0-...-bba1011 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 10 Imported by: 0

README

CRUD in Go with GORM,Testify ,Docker Compose, Redis, and PostgreSQL

This is a simple example of a CRUD application in Go that uses GORM as the ORM, Docker Compose for container orchestration, and Redis and PostgreSQL as databases. Configuration

Make sure you have Docker and Docker Compose installed on your machine.

Clone the repository:

git clone github.com/isaquerr25/crud-go-gin-redis-gorm-testify-docker

Create a .env file in the project root and configure the necessary environment variables. An example can be found in the .env.example file.

Start the containers using Docker Compose:

docker-compose up -d

Run the application:

    go run main.go

Routes

GET /users: Get all users.
GET /users/:id: Get a specific user.
POST /users: Create a new user.
PUT /users/:id: Update an existing user.
DELETE /users/:id: Delete a user.

Tests

Run the tests using the following command:

go test

Cleanup

To stop and remove the containers, run:

docker-compose down

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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