rename src/api to src/api_schema

This commit is contained in:
Dietmar Maurer 2019-02-17 09:59:20 +01:00
parent 5ddf8cb10a
commit dc9a007b11
35 changed files with 72 additions and 74 deletions

View File

@ -1,7 +1,7 @@
//use failure::*; //use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json}; use serde_json::{json};
use std::sync::Arc; use std::sync::Arc;

View File

@ -1,8 +1,8 @@
use failure::*; use failure::*;
use crate::tools; use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use crate::tools::ticket::*; use crate::tools::ticket::*;
use crate::auth_helpers::*; use crate::auth_helpers::*;

View File

@ -1,5 +1,5 @@
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json}; use serde_json::{json};
pub mod datastore; pub mod datastore;

View File

@ -1,7 +1,7 @@
use failure::*; use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
//use crate::server::rest::*; //use crate::server::rest::*;
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -4,8 +4,8 @@ use crate::tools;
use crate::tools::wrapped_reader_stream::*; use crate::tools::wrapped_reader_stream::*;
use crate::backup::*; use crate::backup::*;
//use crate::server::rest::*; //use crate::server::rest::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use chrono::{Utc, TimeZone}; use chrono::{Utc, TimeZone};

View File

@ -1,8 +1,8 @@
//use failure::*; //use failure::*;
//use std::collections::HashMap; //use std::collections::HashMap;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json}; use serde_json::{json};
pub mod datastore; pub mod datastore;

View File

@ -1,8 +1,8 @@
use failure::*; use failure::*;
//use std::collections::HashMap; //use std::collections::HashMap;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use crate::backup::*; use crate::backup::*;
use serde_json::{json, Value}; use serde_json::{json, Value};
use std::path::PathBuf; use std::path::PathBuf;

View File

@ -1,5 +1,5 @@
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json}; use serde_json::{json};
mod time; mod time;

View File

@ -3,8 +3,8 @@ use failure::*;
use crate::tools; use crate::tools;
use crate::api2::*; use crate::api2::*;
//use crate::api::schema::*; //use crate::api_schema::schema::*;
//use crate::api::router::*; //use crate::api_schema::router::*;
use lazy_static::lazy_static; use lazy_static::lazy_static;

View File

@ -1,8 +1,8 @@
use failure::*; use failure::*;
//use crate::tools; //use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -1,8 +1,8 @@
use failure::*; use failure::*;
use crate::tools; use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json, Value}; use serde_json::{json, Value};
use std::sync::Arc; use std::sync::Arc;

View File

@ -1,7 +1,7 @@
use failure::*; use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json, Value}; use serde_json::{json, Value};
use std::sync::Arc; use std::sync::Arc;

View File

@ -1,8 +1,8 @@
use failure::*; use failure::*;
use crate::tools; use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json, Value}; use serde_json::{json, Value};
use chrono::prelude::*; use chrono::prelude::*;

View File

@ -1,8 +1,8 @@
use failure::*; use failure::*;
use crate::tools; use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -1,7 +1,7 @@
use failure::*; use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use serde_json::{json, Value}; use serde_json::{json, Value};
const PROXMOX_PKG_VERSION: &'static str = env!("PROXMOX_PKG_VERSION"); const PROXMOX_PKG_VERSION: &'static str = env!("PROXMOX_PKG_VERSION");

16
src/api_schema.rs Normal file
View File

@ -0,0 +1,16 @@
//! API definition helper
//!
//! This module contains helper classes to define REST APIs. Method
//! parameters and return types are described using a
//! [Schema](schema/enum.Schema.html).
//!
//! The [Router](router/struct.Router.html) is used to define a
//! hierarchy of API entries, and provides ways to find an API
//! definition by path.
#[macro_use]
pub mod schema;
pub mod registry;
#[macro_use]
pub mod router;
pub mod config;

View File

@ -1,4 +1,4 @@
use crate::api::router::*; use crate::api_schema::router::*;
use std::collections::HashMap; use std::collections::HashMap;
use std::path::{PathBuf}; use std::path::{PathBuf};

View File

@ -1,4 +1,4 @@
use crate::api::schema::*; use crate::api_schema::schema::*;
use failure::*; use failure::*;
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -1,6 +1,6 @@
use failure::*; use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use serde_json::{Value}; use serde_json::{Value};
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;

View File

@ -4,8 +4,8 @@ use failure::*;
use proxmox_backup::tools; use proxmox_backup::tools;
use proxmox_backup::cli::command::*; use proxmox_backup::cli::command::*;
use proxmox_backup::api::schema::*; use proxmox_backup::api_schema::schema::*;
use proxmox_backup::api::router::*; use proxmox_backup::api_schema::router::*;
use serde_json::{Value}; use serde_json::{Value};

View File

@ -1,8 +1,8 @@
extern crate proxmox_backup; extern crate proxmox_backup;
//use proxmox_backup::tools; //use proxmox_backup::tools;
use proxmox_backup::api::router::*; use proxmox_backup::api_schema::router::*;
use proxmox_backup::api::config::*; use proxmox_backup::api_schema::config::*;
use proxmox_backup::server::rest::*; use proxmox_backup::server::rest::*;
use proxmox_backup::auth_helpers::*; use proxmox_backup::auth_helpers::*;
use proxmox_backup::config; use proxmox_backup::config;

View File

@ -5,8 +5,8 @@ use failure::*;
use proxmox_backup::tools; use proxmox_backup::tools;
use proxmox_backup::cli::command::*; use proxmox_backup::cli::command::*;
use proxmox_backup::api::schema::*; use proxmox_backup::api_schema::schema::*;
use proxmox_backup::api::router::*; use proxmox_backup::api_schema::router::*;
use proxmox_backup::client::*; use proxmox_backup::client::*;
//use proxmox_backup::backup::chunk_store::*; //use proxmox_backup::backup::chunk_store::*;
//use proxmox_backup::backup::image_index::*; //use proxmox_backup::backup::image_index::*;

View File

@ -2,8 +2,8 @@
extern crate proxmox_backup; extern crate proxmox_backup;
use proxmox_backup::tools; use proxmox_backup::tools;
use proxmox_backup::api::router::*; use proxmox_backup::api_schema::router::*;
use proxmox_backup::api::config::*; use proxmox_backup::api_schema::config::*;
use proxmox_backup::server::rest::*; use proxmox_backup::server::rest::*;
use proxmox_backup::auth_helpers::*; use proxmox_backup::auth_helpers::*;

View File

@ -4,9 +4,9 @@ use std::collections::HashSet;
use serde_json::Value; use serde_json::Value;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
//use crate::api::config::*; //use crate::api_schema::config::*;
use super::environment::CliEnvironment; use super::environment::CliEnvironment;
use crate::getopts; use crate::getopts;

View File

@ -1,4 +1,4 @@
use crate::api::router::*; use crate::api_schema::router::*;
use std::collections::HashMap; use std::collections::HashMap;
use serde_json::Value; use serde_json::Value;

View File

@ -1,6 +1,6 @@
use failure::*; use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use std::sync::Arc; use std::sync::Arc;
use lazy_static::lazy_static; use lazy_static::lazy_static;

View File

@ -5,7 +5,7 @@ use std::io::Read;
//use std::sync::Arc; //use std::sync::Arc;
use crate::tools; use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::section_config::*; use crate::section_config::*;

View File

@ -1,4 +1,4 @@
use crate::api::schema::*; use crate::api_schema::schema::*;
use failure::*; use failure::*;

View File

@ -4,26 +4,8 @@ pub mod buildcfg;
#[macro_use] #[macro_use]
pub mod tools; pub mod tools;
/// API definition helper
///
/// This module contains helper classes to define REST APIs. Method
/// parameters and return types are described using a
/// [Schema](schema/enum.Schema.html).
///
/// The [Router](router/struct.Router.html) is used to define a
/// hierarchy of API entries, and provides ways to find an API
/// definition by path.
#[macro_use] #[macro_use]
pub mod api { pub mod api_schema;
#[macro_use]
pub mod schema;
pub mod registry;
#[macro_use]
pub mod router;
pub mod config;
}
#[macro_use] #[macro_use]
pub mod server { pub mod server {

View File

@ -7,7 +7,7 @@ use std::collections::VecDeque;
use serde_json::{json, Value}; use serde_json::{json, Value};
use std::sync::Arc; use std::sync::Arc;
use crate::api::schema::*; use crate::api_schema::schema::*;
pub struct SectionConfigPlugin { pub struct SectionConfigPlugin {
type_name: String, type_name: String,

View File

@ -1,4 +1,4 @@
use crate::api::router::*; use crate::api_schema::router::*;
use std::collections::HashMap; use std::collections::HashMap;
use serde_json::Value; use serde_json::Value;

View File

@ -1,7 +1,7 @@
use failure::*; use failure::*;
use serde_json::{json, Value}; use serde_json::{json, Value};
use crate::api::router::RpcEnvironment; use crate::api_schema::router::RpcEnvironment;
use hyper::{Body, Response, StatusCode}; use hyper::{Body, Response, StatusCode};
use hyper::header; use hyper::header;

View File

@ -1,7 +1,7 @@
use crate::tools; use crate::tools;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::api::router::*; use crate::api_schema::router::*;
use crate::api::config::*; use crate::api_schema::config::*;
use crate::auth_helpers::*; use crate::auth_helpers::*;
use super::environment::RestEnvironment; use super::environment::RestEnvironment;
use super::formatter::*; use super::formatter::*;

View File

@ -1,6 +1,6 @@
use failure::*; use failure::*;
use crate::api::schema::*; use crate::api_schema::schema::*;
use crate::section_config::*; use crate::section_config::*;
use lazy_static::lazy_static; use lazy_static::lazy_static;