This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
Port: 5005 | |
RunMode: debug | |
logger: | |
filePath: ../logs/logs.log | |
Encoding: json | |
level: debug | |
cors: | |
allowOrigins: "*" | |
postgres: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package routers | |
import ( | |
"github.com/gin-gonic/gin" | |
"github.com/naeemaei/golang-clean-web-api/api/handlers" | |
) | |
func Health(r *gin.RouterGroup) { | |
handler := handlers.NewHealthHandler() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package handlers | |
import ( | |
"net/http" | |
"github.com/gin-gonic/gin" | |
) | |
type HealthHandler struct { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Launch Package", | |
"type": "go", | |
"request": "launch", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- job_name: "web-api" | |
scrape_interval: 5s | |
dns_sd_configs: | |
- names: | |
- "tasks.web-api" | |
type: "A" | |
port: 8008 | |
metrics_path: /metrics-text | |
scheme: http | |
static_configs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.5' | |
services: | |
postgres: | |
container_name: postgres_container | |
image: postgres | |
environment: | |
POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} | |
PGDATA: /data/postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create invoice items | |
public class InvoiceBuilder | |
{ | |
private InvoiceCalculator InvoiceCalculator { get; set; } | |
public InvoiceBuilder() | |
{ | |
InvoiceCalculator = new InvoiceCalculator(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Test | |
{ | |
Public Test() | |
{ | |
} | |
} |