more api type cleanups: avoid re-exports
This commit is contained in:
@ -4,11 +4,10 @@ use anyhow::{format_err, Error};
|
||||
use std::sync::Arc;
|
||||
|
||||
use pbs_tools::ticket::{self, Ticket};
|
||||
use pbs_config::token_shadow;
|
||||
use pbs_config::{token_shadow, CachedUserInfo};
|
||||
use pbs_api_types::{Authid, Userid};
|
||||
|
||||
use crate::api2::types::{Authid, Userid};
|
||||
use crate::auth_helpers::*;
|
||||
use pbs_config::CachedUserInfo;
|
||||
use crate::tools;
|
||||
|
||||
use hyper::header;
|
||||
|
@ -1,9 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
use anyhow::Error;
|
||||
|
||||
use pbs_api_types::Authid;
|
||||
|
||||
use crate::{
|
||||
server::WorkerTask,
|
||||
api2::types::*,
|
||||
server::jobstate::Job,
|
||||
backup::DataStore,
|
||||
};
|
||||
|
@ -48,15 +48,12 @@ use proxmox::tools::fs::{
|
||||
|
||||
use pbs_systemd::time::{compute_next_event, parse_calendar_event};
|
||||
use pbs_config::{open_backup_lockfile, BackupLockGuard};
|
||||
use pbs_api_types::{UPID, JobScheduleStatus};
|
||||
|
||||
use crate::{
|
||||
api2::types::JobScheduleStatus,
|
||||
server::{
|
||||
UPID,
|
||||
TaskState,
|
||||
upid_read_status,
|
||||
worker_is_active_local,
|
||||
},
|
||||
use crate::server::{
|
||||
TaskState,
|
||||
upid_read_status,
|
||||
worker_is_active_local,
|
||||
};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
@ -32,13 +32,13 @@ use proxmox::http_err;
|
||||
|
||||
use pbs_tools::compression::{DeflateEncoder, Level};
|
||||
use pbs_tools::stream::AsyncReaderStream;
|
||||
use pbs_api_types::{Authid, Userid};
|
||||
|
||||
use super::auth::AuthError;
|
||||
use super::environment::RestEnvironment;
|
||||
use super::formatter::*;
|
||||
use super::ApiConfig;
|
||||
|
||||
use crate::api2::types::{Authid, Userid};
|
||||
use crate::auth_helpers::*;
|
||||
use pbs_config::CachedUserInfo;
|
||||
use crate::tools;
|
||||
|
@ -3,7 +3,8 @@ use std::fmt;
|
||||
use anyhow::{bail, Error};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::api2::types::Userid;
|
||||
use pbs_api_types::Userid;
|
||||
|
||||
use crate::config::tfa;
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
|
@ -1,5 +1,3 @@
|
||||
pub use pbs_api_types::upid::UPID;
|
||||
|
||||
pub trait UPIDExt: private::Sealed {
|
||||
/// Returns the absolute path to the task log file
|
||||
fn log_path(&self) -> std::path::PathBuf;
|
||||
@ -7,10 +5,10 @@ pub trait UPIDExt: private::Sealed {
|
||||
|
||||
mod private {
|
||||
pub trait Sealed {}
|
||||
impl Sealed for super::UPID {}
|
||||
impl Sealed for pbs_api_types::UPID {}
|
||||
}
|
||||
|
||||
impl UPIDExt for UPID {
|
||||
impl UPIDExt for pbs_api_types::UPID {
|
||||
fn log_path(&self) -> std::path::PathBuf {
|
||||
let mut path = std::path::PathBuf::from(super::PROXMOX_BACKUP_TASK_DIR);
|
||||
path.push(format!("{:02X}", self.pstart % 256));
|
||||
|
@ -18,13 +18,13 @@ use proxmox::tools::fs::{create_path, replace_file, CreateOptions};
|
||||
|
||||
use pbs_buildcfg;
|
||||
use pbs_tools::logrotate::{LogRotate, LogRotateFiles};
|
||||
use pbs_api_types::{Authid, TaskStateType, UPID};
|
||||
use pbs_config::{open_backup_lockfile, BackupLockGuard};
|
||||
|
||||
use super::{UPID, UPIDExt};
|
||||
use super::UPIDExt;
|
||||
|
||||
use crate::server;
|
||||
use crate::tools::{FileLogger, FileLogOptions};
|
||||
use crate::api2::types::{Authid, TaskStateType};
|
||||
use pbs_config::{open_backup_lockfile, BackupLockGuard};
|
||||
|
||||
macro_rules! taskdir {
|
||||
($subdir:expr) => (concat!(pbs_buildcfg::PROXMOX_BACKUP_LOG_DIR_M!(), "/tasks", $subdir))
|
||||
|
Reference in New Issue
Block a user