Elegant, clean Rust development framework

Related tags

Miscellaneous tardis
Overview

Preview version, will not guarantee the stability of the API!

Elegant, clean Rust development framework

Core Features

  • Relational database client for MySQL, PostgresSQL

  • Web service and web client for OpenAPI v3.x

  • Distributed cache client for Redis protocol

  • RabbitMQ client for AMQP protocol

  • Containerized unit testing of mainstream middleware

  • Multi-environment configuration

  • Commonly used operations (E.g. uniform error handling, encryption and decryption, regular checksums)

Feature Description

  • trace tracing operation

  • future asynchronous operations

  • reldb relational database operations

  • web-server web service operations

  • web-client web client operations

  • cache cache operations

  • mq message queue operations

  • test unit test operations

Quick start

The core operations of the framework all use TardisFuns as an entry point. E.g.

TardisFuns::init(relative_path)      // Initialize the configuration
TardisFuns::field.x                  // Some field operations
TardisFuns::reldb().x                // Some relational database operations
TardisFuns::web_server().x           // Some web service operations

Web Service Example

Dependency Configuration
[dependencies]
tokio = { version = "1.15.0", features = ["macros"] }
tardis = { version = "0", features = ["web-server"] }
poem-openapi = { version = "1.2.39"}
Processor Configuration
>) -> TardisResp { match name.0 { Some(name) => TardisResp::ok(format!("hello, {}!", name)), None => TardisResp::err(TardisError::NotFound("name does not exist".to_string())), } } }">
pub struct Api;

#[OpenApi]
impl Api {
    #[oai(path = "/hello", method = "get")]
    async fn index(&self, name: Query<Option<String>>) -> TardisResp<String> {
        match name.0 {
            Some(name) => TardisResp::ok(format!("hello, {}!", name)),
            None => TardisResp::err(TardisError::NotFound("name does not exist".to_string())),
        }
    }
}
Startup class configuration
#[tokio::main]
async fn main() -> TardisResult<()> {
    // Initial configuration
    TardisFuns::init::
        (
        "config").
        await?;
    
        // Register the processor and start the web service
    TardisFuns
        ::
        web_server().
        add_module(
        "", Api).
        start().
        await
}
       

Relational Database Example

TBD

You might also like...
OptFrame is an optimization framework focused in metaheuristic techniques

optframe-rust Welcome to OptFrame project in Rust. What is OptFrame? OptFrame is an optimization framework focused in metaheuristic techniques, develo

Moonshine CSS - 🥃 High-proof atomic CSS framework

Moonshine CSS - 🥃 High-proof atomic CSS framework

 RustHunter is a modular incident response framework to build and compare environmental baselines
RustHunter is a modular incident response framework to build and compare environmental baselines

RustHunter is a modular incident response framework to build and compare environmental baselines. It is written in Rust and uses Ansible to collect data across multiple hosts.

Blazingly fast spam classification API built using Rocket Web Framework.

Telegram Antispam API Blazingly fast spam classification API built using Rocket Web Framework. Notes The classifier works in aggressive mode, it can s

First Git on Rust is reimplementation with rust in order to learn about rust, c and git.

First Git on Rust First Git on Rust is reimplementation with rust in order to learn about rust, c and git. Reference project This project refer to the

A stupid macro that compiles and executes Rust and spits the output directly into your Rust code

inline-rust This is a stupid macro inspired by inline-python that compiles and executes Rust and spits the output directly into your Rust code. There

Learn-rust - An in-depth resource to learn Rust 🦀

Learning Rust 🦀 Hello friend! 👋 Welcome to my "Learning Rust" repo, a home for my notes as I'm learning Rust. I'm structuring everything into lesson

A highly modular Bitcoin Lightning library written in Rust. Its Rust-Lightning, not Rusty's Lightning!

Rust-Lightning is a Bitcoin Lightning library written in Rust. The main crate, lightning, does not handle networking, persistence, or any other I/O. Thus, it is runtime-agnostic, but users must implement basic networking logic, chain interactions, and disk storage. More information is available in the About section.

Telegram bot help you to run Rust code in Telegram via Rust playground
Telegram bot help you to run Rust code in Telegram via Rust playground

RPG_BOT (Rust Playground Bot) Telegram bot help you to run Rust code in Telegram via Rust playground Bot interface The bot supports 3 straightforward

Comments
  • add instructions for deploy openssl-sys on FreeBSD

    add instructions for deploy openssl-sys on FreeBSD

    With those command,you will be able to deploy openssl-sys on FreeBSD via vcpkg

     sudo pkg install cmake ninja zip pkgconf gmake
     git clone https://github.com/Microsoft/vcpkg --depth=1
     cd vcpkg
     sh bootstrap-vcpkg.sh
     ./vcpkg integrate install
     ./vcpkg install openssl
    
    opened by passedbylove 0
Releases(0.1.0-alpha32)
Owner
Ideal World
Coding Ideal World
Ideal World
A clean implementation of Reso using Rust.

A clean implementation of Reso using Rust. The principle of Reso Rust is almost identical to Reso, only missing some functionality

Matas Minelga 12 Nov 26, 2022
A clean, custom-built modular kernel ready to boot on x86_64.

Lateral is a work-in-progress multitasking monolithic kernel + OS meant as a fun summer project. It has recently expanded into more than I could imagi

Carter Reeb 109 May 7, 2022
A clean and simple network looking glass application

lg lg is my custom Looking Glass server software for use in ZZANet. The whole application is lightweight, self-contained, and easy to use even outside

Evan Pratten 2 Dec 16, 2022
Terra development suite

rover Terra development suite Planned features Usage Commands Planned features Includes a starter smart contract, can be cw-template or similar. Has a

Jason Stallings 3 Nov 9, 2021
A Rust framework for building context-sensitive type conversion.

Xylem is a stateful type conversion framework for Rust.

Jonathan Chan Kwan Yin 4 May 11, 2022
BlackBird is a framework for Rust Tokio

BlackBird Blackbird is framework like OTP for Erlang. Blackbird is not a Actor Framewrok, it's Behavior for around Tokio task This project currently p

DanyalMh 25 Dec 15, 2022
simple lottery maker made with rust, just web framework

Toy project for fun It's just for fun! making plausible lottery numbers for Korea made with rust This lottery web framework generates and presents pla

yacho (bakjuna) 4 Nov 24, 2023
⚡rustygram is a minimal and blazing fast telegram notification framework for Rust

⚡rustygram ⚡rustygram is a minimal and blazing fast telegram notification framework using Rust. Abstracts away the Telegram API complexity so your app

Chia Yong Kang 15 Dec 1, 2023
The 峨眉 (EMei) JIT/AOT backend framework.

emei The 峨眉 (EMei) JIT/AOT backend framework. Support Instructions x86_64 mov mov mov_zero_extend_bit8/16 mov_sign_extend_bit8/16/32 mov_rev movs(is m

Lyzh 14 Apr 11, 2022
Nimbus is a framework for building parachain consensus systems on cumulus-based parachains.

Cumulo -- Nimbus ⛈️ Nimbus is a framework for building parachain consensus systems on cumulus-based parachains. Given the regular six-second pulse-lik

null 36 Dec 14, 2022