mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 10:32:19 +00:00
Move Resource and xml_snippets to dav crate
This commit is contained in:
@@ -17,10 +17,8 @@ use tokio::sync::RwLock;
|
|||||||
pub mod depth_extractor;
|
pub mod depth_extractor;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod proptypes;
|
pub mod proptypes;
|
||||||
pub mod resource;
|
|
||||||
pub mod resources;
|
pub mod resources;
|
||||||
pub mod routes;
|
pub mod routes;
|
||||||
mod xml_snippets;
|
|
||||||
|
|
||||||
pub struct CalDavContext<C: CalendarStore> {
|
pub struct CalDavContext<C: CalendarStore> {
|
||||||
pub prefix: String,
|
pub prefix: String,
|
||||||
|
|||||||
@@ -8,11 +8,8 @@ use rustical_auth::AuthInfo;
|
|||||||
use rustical_store::calendar::{Calendar, CalendarStore};
|
use rustical_store::calendar::{Calendar, CalendarStore};
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|
||||||
use crate::{
|
use crate::proptypes::{write_href_prop, write_string_prop};
|
||||||
proptypes::{write_href_prop, write_string_prop},
|
use rustical_dav::{resource::Resource, xml_snippets::write_resourcetype};
|
||||||
resource::Resource,
|
|
||||||
xml_snippets::write_resourcetype,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct CalendarResource<C: CalendarStore> {
|
pub struct CalendarResource<C: CalendarStore> {
|
||||||
pub cal_store: Arc<RwLock<C>>,
|
pub cal_store: Arc<RwLock<C>>,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use std::sync::Arc;
|
use crate::proptypes::write_string_prop;
|
||||||
|
|
||||||
use crate::{proptypes::write_string_prop, resource::Resource};
|
|
||||||
use actix_web::{web::Data, HttpRequest};
|
use actix_web::{web::Data, HttpRequest};
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use rustical_auth::AuthInfo;
|
use rustical_auth::AuthInfo;
|
||||||
|
use rustical_dav::resource::Resource;
|
||||||
use rustical_store::calendar::{CalendarStore, Event};
|
use rustical_store::calendar::{CalendarStore, Event};
|
||||||
|
use std::sync::Arc;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|
||||||
pub struct EventResource<C: CalendarStore> {
|
pub struct EventResource<C: CalendarStore> {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
use std::sync::Arc;
|
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 actix_web::{web::Data, HttpRequest};
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use quick_xml::events::BytesText;
|
use quick_xml::events::BytesText;
|
||||||
use rustical_auth::AuthInfo;
|
use rustical_auth::AuthInfo;
|
||||||
|
use rustical_dav::{resource::Resource, xml_snippets::write_resourcetype};
|
||||||
use rustical_store::calendar::CalendarStore;
|
use rustical_store::calendar::CalendarStore;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
use crate::{resource::Resource, xml_snippets::write_resourcetype};
|
|
||||||
use actix_web::HttpRequest;
|
use actix_web::HttpRequest;
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use quick_xml::events::BytesText;
|
use quick_xml::events::BytesText;
|
||||||
use rustical_auth::AuthInfo;
|
use rustical_auth::AuthInfo;
|
||||||
|
use rustical_dav::{resource::Resource, xml_snippets::write_resourcetype};
|
||||||
|
|
||||||
pub struct RootResource {
|
pub struct RootResource {
|
||||||
prefix: String,
|
prefix: String,
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
use rustical_dav::namespace::Namespace;
|
|
||||||
use crate::resource::HandlePropfind;
|
|
||||||
use crate::resources::event::EventResource;
|
use crate::resources::event::EventResource;
|
||||||
use crate::xml_snippets::generate_multistatus;
|
|
||||||
use crate::{CalDavContext, Error};
|
use crate::{CalDavContext, Error};
|
||||||
use actix_web::http::header::ContentType;
|
use actix_web::http::header::ContentType;
|
||||||
use actix_web::web::{Data, Path};
|
use actix_web::web::{Data, Path};
|
||||||
@@ -10,6 +7,9 @@ use anyhow::Result;
|
|||||||
use quick_xml::events::BytesText;
|
use quick_xml::events::BytesText;
|
||||||
use roxmltree::{Node, NodeType};
|
use roxmltree::{Node, NodeType};
|
||||||
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
|
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 rustical_store::calendar::{Calendar, CalendarStore, Event};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
use crate::depth_extractor::Depth;
|
use crate::depth_extractor::Depth;
|
||||||
use crate::resource::{HandlePropfind, Resource};
|
|
||||||
use crate::xml_snippets::generate_multistatus;
|
|
||||||
use crate::CalDavContext;
|
use crate::CalDavContext;
|
||||||
use actix_web::http::header::ContentType;
|
use actix_web::http::header::ContentType;
|
||||||
use actix_web::http::StatusCode;
|
use actix_web::http::StatusCode;
|
||||||
@@ -10,6 +8,8 @@ use anyhow::Result;
|
|||||||
use quick_xml::events::BytesText;
|
use quick_xml::events::BytesText;
|
||||||
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
|
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
|
||||||
use rustical_dav::namespace::Namespace;
|
use rustical_dav::namespace::Namespace;
|
||||||
|
use rustical_dav::resource::{HandlePropfind, Resource};
|
||||||
|
use rustical_dav::xml_snippets::generate_multistatus;
|
||||||
use rustical_store::calendar::CalendarStore;
|
use rustical_store::calendar::CalendarStore;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,8 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
actix-web = "4.4.0"
|
||||||
|
anyhow = "1.0.75"
|
||||||
|
async-trait = "0.1.73"
|
||||||
quick-xml = "0.30.0"
|
quick-xml = "0.30.0"
|
||||||
|
rustical_auth = { path = "../auth/" }
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
pub mod namespace;
|
pub mod namespace;
|
||||||
|
pub mod resource;
|
||||||
|
pub mod xml_snippets;
|
||||||
|
|||||||
Reference in New Issue
Block a user