- config: Viper YAML 配置 + 环境变量覆盖 - logs: zap 结构化日志 + trace_id 链路追踪 + 敏感信息脱敏 - db: PostgreSQL (GORM) + Redis (go-redis) 连接管理 - middleware: Trace/Logger/CORS/Recovery 四层中间件 - provider: Wire 编译时依赖注入 - main.go: 优雅启动/关闭 HTTP 服务 Made-with: Cursor
31 lines
466 B
YAML
31 lines
466 B
YAML
server:
|
|
port: 8080
|
|
mode: debug
|
|
|
|
database:
|
|
host: localhost
|
|
port: 5432
|
|
user: echochat
|
|
password: echochat_dev_2026
|
|
dbname: echochat
|
|
sslmode: disable
|
|
max_idle_conns: 10
|
|
max_open_conns: 100
|
|
|
|
redis:
|
|
host: localhost
|
|
port: 6379
|
|
password: ""
|
|
db: 0
|
|
|
|
jwt:
|
|
secret: echochat-dev-jwt-secret-2026-please-change-in-production
|
|
access_expire_min: 120
|
|
refresh_expire_day: 7
|
|
issuer: echochat
|
|
|
|
log:
|
|
level: debug
|
|
format: text
|
|
output_path: stdout
|