5 releases

0.1.4 Aug 1, 2024
0.1.3 Jul 30, 2024
0.1.2 Jul 29, 2024
0.1.1 Jul 29, 2024
0.1.0 Jul 29, 2024

#756 in Web programming

Download history 256/week @ 2024-07-24 171/week @ 2024-07-31 1/week @ 2024-08-07

181 downloads per month

MIT license

27KB
683 lines

elf_utils

A tool library based on elf_rust. The default method encapsulates some of my own logic. It can be used as a reference for the use of elf_rust and cloud_task_executor, but don't use it directly unless you and I are in the same company.

Usage

Add this to your Cargo.toml:

[dependencies]
elf_utils = "0.1.4"

Example

use log::info;
use serde_json::Value;
use elf_utils::*;

async fn my_task(_ctx: Context, payload: Value) -> Result<String, String> {
    info!("Task running with sample value: {:?}",payload);
    Ok("Task result".to_string())
}

#[tokio::main]
async fn main() {
    default_handle_script("my_task", my_task).await;
}

Environment Variables

  • RUST_LOG=debug # log level, default is info
  • FeiShu_WEBHOOK # feishu webhook url
  • FeiShu_SECRET # feishu secret
  • TASK_MASTER # feishu uid
  • REPORT_HOST # report host

Dependencies

~16–31MB
~523K SLoC