If you like this repo or found it helpful, please give it a star. Thanks!
docker compose -f "docker/docker-compose.yml" up -d setup elasticsearch kibana filebeat postgres pgadmin redis prometheus node-exporter alertmanager grafana
cd src
go install github.com/swaggo/swag/cmd/swag@latest
cd src/cmd
go run main.go
docker compose -f "docker/docker-compose.yml" down
curl -X 'POST' \
'http://localhost:5005/api/v1/users/login-by-username' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"password": "12345678",
"username": "admin"
}'
{
"filter": {
"Name": {
"filterType": "text",
"from": "t",
"type": "contains"
}
},
"pageNumber": 1,
"pageSize": 10,
"sort": [
{
"colId": "name",
"sort": "desc"
}
]
}
{
"filter": {
"Id": { // Column name
"filterType": "number", // number, text,...
"from": "1",
"to": "7",
"type": "inRange" // contains, equals,...
}
},
"pageNumber": 1,
"pageSize": 10,
"sort": [
{
"colId": "name",
"sort": "desc"
}
]
}
docker compose -f "docker/docker-compose.yml" up -d --build
Token Url: http://localhost:9001/api/v1/users/login-by-username
Username: admin
Password: 12345678
Username: elastic
Password: @aA123456
Username: admin
Password: foobar
Username: h.naimaei@gmail.com
Password: 123456
Postgres Server info:
Host: postgres_container
Port: 5432
Username: postgres
Password: admin
docker compose -f 'docker/docker-compose.yml' --project-name 'docker' down
/src > go build -o ../prod/server ./cmd/main.go
/src > mkdir ../prod/config/ && cp config/config-production.yml ../prod/config/config-production.yml
sudo vi /lib/systemd/system/go-api.service
[Unit]
Description=go-api
[Service]
Type=simple
Restart=always
RestartSec=20s
ExecStart=/home/hamed/github/golang-clean-web-api/prod/server
Environment="APP_ENV=production"
WorkingDirectory=/home/hamed/github/golang-clean-web-api/prod
[Install]
WantedBy=multi-user.target
sudo systemctl start go-api
sudo systemctl stop go-api
sudo journalctl -u go-api -e