Opinionated GoLang web framework for microservices based on FastHTTP.
- HTTP web server valyala/fasthttp
- HTTP/2 support forked dgrr/http2
- Web socket support dgrr/websocket
- Structured logger go.uber.org/zap
- JSON serialization goccy/go-json
- Data structure validation using go-playground/validator
- Built-in web app testing framework
ENVIRONMENT- App environment setting (allowed values aredevelopment,test,stagingandproduction).LOG_TYPE- Log type (defaults toconsole, allowed values areconsole,file,otel(provided by azugo.io/opentelemetry) or other registered log drivers).LOG_LEVEL- Minimal log level (defaults toinfo, allowed values aredebug,info,warn,error,dpanic,panic,fatal).LOG_FORMAT- Log output format (defaults toconsolein development environment andecsjsonin staging and production).LOG_OUTPUT- Log output location (defaults tostderr, allowed values arestderr,stdout, file path orfile://URL and other values supported by registered log drivers).LOG_STACKTRACE- Enable stack traces for error level and above regardless of environment (defaults tofalse).LOG_TYPE_SECONDARY- Secondary log type (seeLOG_TYPE).LOG_LEVEL_SECONDARY- Secondary log level (defaults toinfo, seeLOG_LEVEL).LOG_FORMAT_SECONDARY- Secondary log format (seeLOG_FORMAT).LOG_OUTPUT_SECONDARY- Secondary log output location (seeLOG_OUTPUT).
SERVER_URLS- Server URL or multiple URLs separated by semicolons to listen on.SERVER_HTTPS_CERTIFICATE_PEM_FILE- Path to PEM file for HTTPS certificate.BASE_PATH- Base path for the app if deployed in a subdirectory.ACCESS_LOG_ENABLED- Enable access logs (defaults totrue).
REVERSE_PROXY_TRUSTED_IPS- Semicolon-separated list of trusted proxy IP addresses or CIDR ranges (defaults to127.0.0.1).REVERSE_PROXY_TRUSTED_HEADERS- Semicolon-separated list of trusted proxy headers (defaults toX-Real-IP;X-Forwarded-For).REVERSE_PROXY_LIMIT- Maximum number of trusted proxies in chain (defaults to1).
CORS_ORIGINS- Semicolon-separated list of allowed CORS origins.
METRICS_ENABLED- Enable Prometheus metrics endpoint (defaults totrue).METRICS_PATH- Metrics endpoint path (defaults to/metrics).METRICS_TRUSTED_IPS- Semicolon-separated list of trusted IP addresses or CIDR ranges allowed to access the metrics endpoint (defaults to127.0.0.1).
HEALTHZ_ENABLED- Enable health check endpoint (defaults totrue).HEALTHZ_TRUSTED_IPS- Semicolon-separated list of trusted IP addresses or CIDR ranges allowed to access the health check endpoint (defaults to all loopback and private network ranges:127.0.0.0/8,::1/128,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7).
PAGING_DEFAULT_PAGE_SIZE- Default page size for paginated responses (defaults to20).PAGING_MAX_PAGE_SIZE- Maximum allowed page size for paginated responses (defaults to100).
CACHE_TYPE- Cache type to use (defaults tomemory, allowed values arememory,redis,redis-cluster,redis-sentinel).CACHE_TTL- Duration to keep items in cache (defaults to0meaning never expire).CACHE_KEY_PREFIX- Prefix all cache keys with specified value.CACHE_CONNECTION- Connection string for non-memory cache backends.CACHE_PASSWORD- Password for cache connection.CACHE_PASSWORD_FILE- File to read value forCACHE_PASSWORDfrom.
- Router largely based on fasthttp/router