The MrAndreID/GoAPI is a skeleton uses the Go Programming Language (GoLang) with The Echo Framework for The Application Programming Interface (API).
- Requirements
- Installation
- Migration
- Seeder
- Unit Test
- Usage
- Versioning
- Authors
- Contributing
- Official Documentation for Go Language
- License
To use The MrAndreID/GoAPI, you must ensure that you meet the following requirements:
- Go >= 1.24
To use The MrAndreID/GoAPI, you must follow the steps below:
- Clone a Repository
# git clone https://github.com/MrAndreID/goapi.git
- Get Dependancies
# go mod download
# go mod tidy- Create .env file from .env.example (Linux)
# cp .env.example .env- Configuring .env file
To Run Migration for The MrAndreID/GoAPI, you must ensure that you meet the following requirements:
- Run Migration for The
MrAndreID/GoAPI
# go run databases/migrations/main.go --migrate=default- Run Migration for The
MrAndreID/GoAPIwith Drop All Tables
# go run databases/migrations/main.go --migrate=freshTo Run Seeder for The MrAndreID/GoAPI, you must ensure that you meet the following requirements:
- Run Seeder for The
MrAndreID/GoAPI
# go run databases/seeders/main.go --seed=defaultTo Run Unit Test for The MrAndreID/GoAPI, you must ensure that you meet the following requirements:
- Create .env file in tests folder from .env.example (Linux)
# cp .env.example tests/.env- Configuring .env file
- Run Unit Test for The
MrAndreID/GoAPI
# go test -v -cover -coverpkg=./internal/handlers ./testsTo use The MrAndreID/GoAPI, you must ensure that you meet the following requirements:
- Directory Structure The
MrAndreID/GoAPI| Name | Description | | :---------------------- | :-------------------------------------------------------- | |application| Initialization of Echo Framework, Middleware, and Routes. | |caches| Configuration for Cache | |configs| Condiguration from Env File | |databases| Configuration for Database | |internal/handlers| HTTP Handlers | |internal/services| Main Business Logic | |internal/repositories| Connector to Database or API External | |internal/types| Struct Data | |messagebrokers| Configuration for Message Broker | |objectstorages| Configuration for Object Storage | |tests| Unit Test | - Run The
MrAndreID/GoAPI
# go run main.go- Run The
MrAndreID/GoAPIwith Docker
# docker build --no-cache -t goapi:1.0.0 .
# docker run --name goapi --restart=always -d -p -v /path/to/folder:/app/storages -v /path/to/folder:/app/tests/storages 10001:10001 goapi:1.0.0
- Set The
MrAndreID/GoAPIto Maintenance Mode in Storages Folder
# touch storages/maintenance.flagI use Semanting Versioning. For the versions available, see the tags on this repository.
- Andrea Adam - MrAndreID
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
Documentation for Go Language can be found on the Go Package website.
The MrAndreID/GoAPI is released under the MIT License. See the LICENSE file for more information.