Skip to content

Instantly share code, notes, and snippets.

View naeemaei's full-sized avatar
🎯
Focusing

Hamed Naeemaei naeemaei

🎯
Focusing
View GitHub Profile
@naeemaei
naeemaei / src--config--config-development.yml
Created October 14, 2023 18:45
config file of golang project
server:
Port: 5005
RunMode: debug
logger:
filePath: ../logs/logs.log
Encoding: json
level: debug
cors:
allowOrigins: "*"
postgres:
@naeemaei
naeemaei / src--api--routers--health.go
Last active October 13, 2023 16:33
Golang web api project gists
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()
@naeemaei
naeemaei / src--api--handlers--health.go
Last active October 13, 2023 16:23
Golang gin health check handler
package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
)
type HealthHandler struct {
}
@naeemaei
naeemaei / launch.json
Created October 13, 2023 14:43
Golang launch setting in VSCode
{
// 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",
@naeemaei
naeemaei / Prometheus-Monitoring-Job.yml
Last active January 2, 2022 13:12
Prometheus Monitoring Job Example
- 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:
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
@naeemaei
naeemaei / InvoiceDependenciesBadExample.cs
Last active March 19, 2020 12:02
Dependency of invoice classes
// Create invoice items
public class InvoiceBuilder
{
private InvoiceCalculator InvoiceCalculator { get; set; }
public InvoiceBuilder()
{
InvoiceCalculator = new InvoiceCalculator();
}
}
@naeemaei
naeemaei / Test.cs
Last active February 6, 2020 22:23
Test Class
using System;
public class Test
{
Public Test()
{
}
}