[鿫-Oganesson] Rust Web开发脚手架,支持 actix-web、 axum 和 salvo 框架,并支持「单应用」和「多应用」模式
cargo install oganesson-rs- DB使用 sqlx
- Redis使用 redis-rs
- 日志使用 tracing
- 配置使用 config-rs
- 命令行使用 clap
- 异步运行时使用 tokio
- 参数验证器使用 validator
- 支持 Prometheus Metrics 和 Request 中间件
- 包含 TraceId、认证、请求日志、Panic捕获 中间件
- 简单好用的 API Result 统一输出方式
点击展开
og init # 在当前目录初始化项目
og new --name demo # 创建demo项目
.
├── Cargo.toml
├── Dockerfile
├── app/
│ ├── Cargo.toml
│ ├── config.toml
│ └── src/
│ ├── ...
│ └── main.rs
└── crates
├── infra/
│ ├── Cargo.toml
│ └── src/
│ ├── ...
│ └── lib.rs
└── repo/
├── Cargo.toml
└── src/
├── ...
└── lib.rs
点击展开
多应用项目适用,需在项目根目录执行(即:
Cargo.toml所在目录)
og app --name foo --name bar
.
├── Cargo.toml
├── Dockerfile.foo
├── Dockerfile.bar
├── apps/
│ ├── foo/
│ │ ├── Cargo.toml
│ │ ├── config.toml
│ │ └── src/
│ │ ├── ...
│ │ └── main.rs
│ └── bar/
│ ├── Cargo.toml
│ ├── config.toml
│ └── src/
│ ├── ...
│ └── main.rs
└── crates
├── infra/
│ ├── Cargo.toml
│ └── src/
│ ├── ...
│ └── lib.rs
└── repo/
├── Cargo.toml
└── src/
├── ...
└── lib.rsEnjoy 😊