Elegant, Clean Rust development framework🛸
TARDIS([tɑːrdɪs] "Time And Relative Dimension In Space") From "Doctor Who".
💖 Core functions
- 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
- Search client for Elasticsearch
- Mail client for SMTP protocol
- Object Storage client for arbitrary S3 compatible APIs
- Mainstream encryption algorithms and SM2/3/4 algorithms
- Containerized unit testing of mainstream middleware
- Multi-environment configuration
- Multi-application aggregation
- Configure encryption support
- Internationalization and localization support
- Commonly used operations (E.g. uniform error handling, encryption and decryption, regular checksums)
⚙️Key Features
conf-remoteenable the unified configuration centercryptoencryption, decryption and digest operationscrypto-with-smencryption, decryption and digest with SM.x operationsfutureasynchronous operationsreldb-corerelational database core operations(based on SeaORM)reldb-postgresrelational database with postgres driverreldb-mysqlrelational database with mysql driverreldb-sqliterelational database with sqlite driverreldbrelational database with postgres/mysql/sqlite driversweb-serverweb service operations(based on Poem)web-server-grpcgrpc web service based on Poemweb-clientweb client operationsws-clientwebsocket client operationscachecache operationsmqmessage queue operationsmailmail send operationsosobject Storage operationstestunit test operationstracingopen telemetry supporttokio-consoleconsole subscriber layer supported by tokio-consoletracing-appenderwrite log into file periodically.build-infoget build info like package version or git version
🚀 Quick start
The core operations of the framework all use TardisFuns as an entry point.
E.g.
init // Initialize the configuration
field.x // Some field operations
reldb.x // Some relational database operations
web_server.x // Some web service operations
Web service example
Dependency Configuration
[]
= { = "^0", = ["web-server"] }
Processor Configuration
use TardisError;
use poem_openapi;
use Query;
use ;
;
Startup class configuration
use TardisResult;
use tokio;
use TardisFuns;
use crateApi;
async
Dependencies
In order to use gRPC features, you need the protoc Protocol Buffers compiler, along with Protocol Buffers resource files.
Ubuntu
&&
Alpine Linux
macOS
Assuming Homebrew is already installed. (If not, see instructions for installing Homebrew on the Homebrew website.)
Windows
- Download the latest version of
protoc-xx.y-win64.zipfrom HERE - Extract the file
bin\protoc.exeand put it somewhere in thePATH - Verify installation by opening a command prompt and enter
protoc --version
More examples
|-- examples
|-- reldb Relational database usage example
|-- web-basic Web service Usage Example
|-- web-client Web client Usage Example
|-- websocket WebSocket Usage Example
|-- cache Cache Usage Example
|-- mq Message Queue Usage Example
|-- todos A complete project usage example
|-- multi-apps Multi-application aggregation example
|-- pg-graph-search Graph search by Postgresql example
|-- perf-test Performance test case
|-- tracing-otlp Trace and send data by otlp prococol example
FAQ
-
An
failed to run custom build command for openssl-syserror occurs when running under Windows.The solution is as follows( @see https://github.com/sfackler/rust-openssl/issues/1062 ):git clone https://github.com/Microsoft/vcpkg --depth=1 cd vcpkg bootstrap-vcpkg.bat vcpkg.exe integrate install vcpkg.exe install openssl:x64-windows-static set OPENSSL_NO_VENDOR=1 set OPENSSL_DIR=<Current Dir>\packages\openssl_x64-windows-static -
An
failed to run custom build command for openssl-syserror occurs when running under Ubuntu(similar to other distributions):apt install build-essential perl pkg-config libssl-dev -
FreeBSD deployment for
openssl-syssudo 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 -
An
failed to run custom build command for opentelemetry-protoerror occurs when running under Linux:apt install protobuf-compiler -
An
failed to run custom build command for opentelemetry-protoerror occurs when running under MacOS:brew install protobuf
Thanks to Jetbrains for the Open Source License