Skip to content

Latest commit

 

History

83 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oganesson-rs

crates.io MIT

[鿫-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.rs

Enjoy 😊

About

Rust 开发脚手架

Topics

Resources

Stars

24 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages