move src/server/formatter.rs to proxmox-rest-server crate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dietmar Maurer 2021-09-21 07:58:43 +02:00 committed by Thomas Lamprecht
parent d4d49f7325
commit 1b552c109d
8 changed files with 8 additions and 8 deletions

View File

@ -5,6 +5,7 @@ use anyhow::{bail, format_err, Error};
use proxmox::tools::fd::Fd; use proxmox::tools::fd::Fd;
pub mod daemon; pub mod daemon;
pub mod formatter;
mod environment; mod environment;
pub use environment::*; pub use environment::*;

View File

@ -54,6 +54,7 @@ use pbs_tools::blocking::WrappedReaderStream;
use pbs_tools::stream::{AsyncReaderStream, AsyncChannelWriter}; use pbs_tools::stream::{AsyncReaderStream, AsyncChannelWriter};
use pbs_tools::json::{required_integer_param, required_string_param}; use pbs_tools::json::{required_integer_param, required_string_param};
use pbs_config::CachedUserInfo; use pbs_config::CachedUserInfo;
use proxmox_rest_server::formatter;
use crate::api2::node::rrd::create_value_from_rrd; use crate::api2::node::rrd::create_value_from_rrd;
use crate::backup::{ use crate::backup::{
@ -1326,7 +1327,7 @@ pub fn upload_backup_log(
replace_file(&path, blob.raw_data(), CreateOptions::new())?; replace_file(&path, blob.raw_data(), CreateOptions::new())?;
// fixme: use correct formatter // fixme: use correct formatter
Ok(crate::server::formatter::json_response(Ok(Value::Null))) Ok(formatter::json_response(Ok(Value::Null)))
}.boxed() }.boxed()
} }

View File

@ -15,10 +15,10 @@ use pbs_datastore::backup_info::{BackupDir, BackupInfo};
use pbs_datastore::dynamic_index::DynamicIndexWriter; use pbs_datastore::dynamic_index::DynamicIndexWriter;
use pbs_datastore::fixed_index::FixedIndexWriter; use pbs_datastore::fixed_index::FixedIndexWriter;
use pbs_api_types::Authid; use pbs_api_types::Authid;
use proxmox_rest_server::formatter::*;
use crate::backup::{verify_backup_dir_with_lock, DataStore}; use crate::backup::{verify_backup_dir_with_lock, DataStore};
use crate::server::WorkerTask; use crate::server::WorkerTask;
use crate::server::formatter::*;
use hyper::{Body, Response}; use hyper::{Body, Response};
#[derive(Copy, Clone, Serialize)] #[derive(Copy, Clone, Serialize)]

View File

@ -7,9 +7,9 @@ use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
use pbs_datastore::backup_info::BackupDir; use pbs_datastore::backup_info::BackupDir;
use pbs_api_types::Authid; use pbs_api_types::Authid;
use proxmox_rest_server::formatter::*;
use crate::backup::DataStore; use crate::backup::DataStore;
use crate::server::formatter::*;
use crate::server::WorkerTask; use crate::server::WorkerTask;
//use proxmox::tools; //use proxmox::tools;

View File

@ -11,8 +11,9 @@ use hyper::{Body, Request, Response, StatusCode};
use proxmox::api::{ApiResponseFuture, HttpError, Router, RpcEnvironment}; use proxmox::api::{ApiResponseFuture, HttpError, Router, RpcEnvironment};
use proxmox::http_err; use proxmox::http_err;
use proxmox_rest_server::formatter::*;
use crate::tools; use crate::tools;
use crate::server::formatter::*;
use crate::server::WorkerTask; use crate::server::WorkerTask;
/// Hyper Service implementation to handle stateful H2 connections. /// Hyper Service implementation to handle stateful H2 connections.

View File

@ -55,8 +55,6 @@ pub use worker_task::*;
mod h2service; mod h2service;
pub use h2service::*; pub use h2service::*;
pub mod formatter;
#[macro_use] #[macro_use]
pub mod rest; pub mod rest;

View File

@ -35,8 +35,7 @@ use pbs_tools::compression::{DeflateEncoder, Level};
use pbs_tools::stream::AsyncReaderStream; use pbs_tools::stream::AsyncReaderStream;
use pbs_api_types::{Authid, Userid}; use pbs_api_types::{Authid, Userid};
use proxmox_rest_server::{ApiConfig, FileLogger, FileLogOptions, AuthError, RestEnvironment}; use proxmox_rest_server::{ApiConfig, FileLogger, FileLogOptions, AuthError, RestEnvironment};
use proxmox_rest_server::formatter::*;
use super::formatter::*;
use crate::auth_helpers::*; use crate::auth_helpers::*;
use pbs_config::CachedUserInfo; use pbs_config::CachedUserInfo;