06_production

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 6 Imported by: 0

README

生产环境配置示例

展示生产环境的最佳实践配置。

功能

  • 生产环境优化配置
  • 健康检查和就绪检查
  • 慢请求监控
  • 链路追踪集成
  • 优雅关闭

运行

# 开发环境
go run main.go

# 模拟生产环境
APP_ENV=production go run main.go

测试

# 健康检查
curl http://localhost:8080/health

# 就绪检查
curl http://localhost:8080/ready

# 获取用户列表
curl http://localhost:8080/api/users

# 创建用户
curl -X POST http://localhost:8080/api/users \
  -H "Content-Type: application/json" \
  -d '{"name":"Alice","email":"alice@example.com"}'

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL