1use std::collections::HashMap;
2use std::io::Write;
3pub mod flags;
4pub mod pretty_print;
5pub mod redbcontrol;
6
7macro_rules! write_io {
8 ($func_name:ident, $prefix:literal) => {
9 pub fn $func_name(data: String) -> Result<(), String> {
10 let out_data = format!("{}-> {} \n", $prefix, data);
11 write!(std::io::stdout(), "{}", out_data).map_err(|e| e.to_string())?;
12 std::io::stdout().flush().map_err(|e| e.to_string())?;
13 Ok(())
14 }
15 };
16}
17
18write_io!(write_io_error, "error:");
19write_io!(write_io_success, "success:");
20write_io!(write_io_info, "info:");
21
22pub struct TableInfo {
23 pub tablename: Vec<String>,
24}
25
26pub struct KvInfo {
27 pub kvdatas: HashMap<String, String>,
28}