Rename 'web' module to 'net'
This commit is contained in:
parent
007ab9efbf
commit
d0a0065807
18 changed files with 17 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::kvs;
|
||||
use crate::web;
|
||||
use crate::net;
|
||||
use anyhow::Error;
|
||||
use clap;
|
||||
|
||||
|
@ -20,7 +20,7 @@ pub fn init(matches: &clap::ArgMatches) -> Result<(), Error> {
|
|||
// Start up the kvs storage
|
||||
kvs::init(matches)?;
|
||||
// Start up the web server
|
||||
web::init(matches)?;
|
||||
net::init(matches)?;
|
||||
// Don't error when done
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ mod err;
|
|||
mod fnc;
|
||||
mod key;
|
||||
mod kvs;
|
||||
mod net;
|
||||
mod sql;
|
||||
mod web;
|
||||
|
||||
fn main() {
|
||||
cli::init(); // Initiate the command line
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::dbs::export;
|
||||
use crate::dbs::Session;
|
||||
use crate::web::conf;
|
||||
use crate::net::conf;
|
||||
use hyper::body::Body;
|
||||
use warp::Filter;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::dbs::Session;
|
||||
use crate::err::Error;
|
||||
use crate::net::conf;
|
||||
use crate::net::head;
|
||||
use crate::net::output;
|
||||
use crate::sql::value::Value;
|
||||
use crate::web::conf;
|
||||
use crate::web::head;
|
||||
use crate::web::output;
|
||||
use bytes::Bytes;
|
||||
use serde::Deserialize;
|
||||
use std::collections::HashMap;
|
||||
|
@ -111,8 +111,11 @@ async fn select_all(
|
|||
l = query.limit.unwrap_or(String::from("100")),
|
||||
s = query.start.unwrap_or(String::from("0")),
|
||||
);
|
||||
let mut vars = HashMap::new();
|
||||
vars.insert(String::from("table"), Value::from(table));
|
||||
let vars = hmap! {
|
||||
String::from("table") => Value::from(table),
|
||||
};
|
||||
// let mut vars = HashMap::new();
|
||||
// vars.insert(String::from("table"), Value::from(table));
|
||||
match crate::dbs::execute(sql.as_str(), session, Some(vars)).await {
|
||||
Ok(ref res) => match output.as_ref() {
|
||||
"application/json" => Ok(output::json(res)),
|
|
@ -1,4 +1,4 @@
|
|||
use crate::web::head;
|
||||
use crate::net::head;
|
||||
use warp::http;
|
||||
use warp::Filter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::web::head;
|
||||
use crate::net::head;
|
||||
use warp::http;
|
||||
use warp::Filter;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::dbs::Session;
|
||||
use crate::web::conf;
|
||||
use crate::web::head;
|
||||
use crate::web::output;
|
||||
use crate::net::conf;
|
||||
use crate::net::head;
|
||||
use crate::net::output;
|
||||
use bytes::Bytes;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use warp::Filter;
|
Loading…
Reference in a new issue