first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:41:46 +03:00
commit b6e74bd024
56 changed files with 16114 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package middleware
import (
"log"
"os"
"strings"
)
func envBool(key string, fallback bool) bool {
raw := strings.TrimSpace(strings.ToLower(os.Getenv(key)))
if raw == "" {
return fallback
}
switch raw {
case "1", "true", "yes", "on":
return true
case "0", "false", "no", "off":
return false
default:
return fallback
}
}
func policyLogf(enabled bool, format string, args ...any) {
if !enabled {
return
}
log.Printf(format, args...)
}