Categorygithub.com/billzayy/crud-go
modulepackage
0.0.0-20240923035301-27c1aafd2150
Repository: https://github.com/billzayy/crud-go.git
Documentation: pkg.go.dev

# README

CRUD GoLang with Swagger

After run docker-compose, you can access http://localhost:<port>/swagger/index.html to open swagger UI.

Require:

  1. Installed Go
  2. Installed Docker

Run without Docker :

  1. First we need to create .env file with copy some code:

    PORT=<PORT>
    DBPATH="<username>:<password>@tcp(<ip>:<port>)/<databases-name>"
    
  2. Second, We run command :

    air
    

    If you can't run air, so please install air :

    go install github.com/cosmtrek/air@latest
    

    Run air -v to check air in your local.


or

Run with Docker Compose:

docker-compose up -d

To run access and create table in database:

  1. You need to copy this line into your terminal:

    docker exec -it db bash
    
  2. Next, access into Mysql Server with:

    mysql -u root -p
    

    After that, type password to input the password

  3. Then, to use a database named golang. Copy this :

    use golang;
    
  4. Finally, go to folder database/db/init.sql/CreateUser.session.sql or click here! and copy all SQL Statements into your terminal.

  5. To check table exists, type this command :

    desc User;
    

    If your mysql server still don't have a User table, rerun docker compose and to it again !!!

# Packages

No description provided by the author
Package docs Code generated by swaggo/swag.
No description provided by the author
No description provided by the author