feat(backend): Go 服务骨架(配置、日志、数据库、中间件、Wire)
- 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
This commit is contained in:
30
backend/go-service/config/config.dev.yaml
Normal file
30
backend/go-service/config/config.dev.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
Reference in New Issue
Block a user