Move Resource and xml_snippets to dav crate

This commit is contained in:
Lennart
2023-09-14 13:39:53 +02:00
parent d8e6b0e0e0
commit c8bd214438
11 changed files with 19 additions and 17 deletions

View File

@@ -17,10 +17,8 @@ use tokio::sync::RwLock;
pub mod depth_extractor;
pub mod error;
pub mod proptypes;
pub mod resource;
pub mod resources;
pub mod routes;
mod xml_snippets;
pub struct CalDavContext<C: CalendarStore> {
pub prefix: String,

View File

@@ -8,11 +8,8 @@ use rustical_auth::AuthInfo;
use rustical_store::calendar::{Calendar, CalendarStore};
use tokio::sync::RwLock;
use crate::{
proptypes::{write_href_prop, write_string_prop},
resource::Resource,
xml_snippets::write_resourcetype,
};
use crate::proptypes::{write_href_prop, write_string_prop};
use rustical_dav::{resource::Resource, xml_snippets::write_resourcetype};
pub struct CalendarResource<C: CalendarStore> {
pub cal_store: Arc<RwLock<C>>,

View File

@@ -1,11 +1,11 @@
use std::sync::Arc;
use crate::{proptypes::write_string_prop, resource::Resource};
use crate::proptypes::write_string_prop;
use actix_web::{web::Data, HttpRequest};
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use rustical_auth::AuthInfo;
use rustical_dav::resource::Resource;
use rustical_store::calendar::{CalendarStore, Event};
use std::sync::Arc;
use tokio::sync::RwLock;
pub struct EventResource<C: CalendarStore> {

View File

@@ -1,11 +1,12 @@
use std::sync::Arc;
use crate::{proptypes::write_href_prop, resource::Resource, xml_snippets::write_resourcetype};
use crate::proptypes::write_href_prop;
use actix_web::{web::Data, HttpRequest};
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use quick_xml::events::BytesText;
use rustical_auth::AuthInfo;
use rustical_dav::{resource::Resource, xml_snippets::write_resourcetype};
use rustical_store::calendar::CalendarStore;
use tokio::sync::RwLock;

View File

@@ -1,9 +1,9 @@
use crate::{resource::Resource, xml_snippets::write_resourcetype};
use actix_web::HttpRequest;
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use quick_xml::events::BytesText;
use rustical_auth::AuthInfo;
use rustical_dav::{resource::Resource, xml_snippets::write_resourcetype};
pub struct RootResource {
prefix: String,

View File

@@ -1,7 +1,4 @@
use rustical_dav::namespace::Namespace;
use crate::resource::HandlePropfind;
use crate::resources::event::EventResource;
use crate::xml_snippets::generate_multistatus;
use crate::{CalDavContext, Error};
use actix_web::http::header::ContentType;
use actix_web::web::{Data, Path};
@@ -10,6 +7,9 @@ use anyhow::Result;
use quick_xml::events::BytesText;
use roxmltree::{Node, NodeType};
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
use rustical_dav::namespace::Namespace;
use rustical_dav::resource::HandlePropfind;
use rustical_dav::xml_snippets::generate_multistatus;
use rustical_store::calendar::{Calendar, CalendarStore, Event};
use std::sync::Arc;
use tokio::sync::RwLock;

View File

@@ -1,6 +1,4 @@
use crate::depth_extractor::Depth;
use crate::resource::{HandlePropfind, Resource};
use crate::xml_snippets::generate_multistatus;
use crate::CalDavContext;
use actix_web::http::header::ContentType;
use actix_web::http::StatusCode;
@@ -10,6 +8,8 @@ use anyhow::Result;
use quick_xml::events::BytesText;
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
use rustical_dav::namespace::Namespace;
use rustical_dav::resource::{HandlePropfind, Resource};
use rustical_dav::xml_snippets::generate_multistatus;
use rustical_store::calendar::CalendarStore;
use thiserror::Error;

View File

@@ -4,4 +4,8 @@ version = "0.1.0"
edition = "2021"
[dependencies]
actix-web = "4.4.0"
anyhow = "1.0.75"
async-trait = "0.1.73"
quick-xml = "0.30.0"
rustical_auth = { path = "../auth/" }

View File

@@ -1 +1,3 @@
pub mod namespace;
pub mod resource;
pub mod xml_snippets;