Refactor store crate

This commit is contained in:
Lennart
2024-09-30 18:23:30 +02:00
parent 2670abfef0
commit acc47e4e24
14 changed files with 18 additions and 14 deletions

View File

@@ -1,8 +1,7 @@
pub mod calendar;
pub mod error;
pub mod event;
pub mod model;
pub mod sqlite_store;
pub mod store;
pub mod timestamps;
pub mod timestamp;
pub use error::Error;
pub use store::CalendarStore;

View File

@@ -1,5 +1,5 @@
use crate::{
timestamps::{parse_duration, CalDateTime},
timestamp::{parse_duration, CalDateTime},
Error,
};
use anyhow::{anyhow, Result};

View File

@@ -0,0 +1,5 @@
pub mod calendar;
pub mod event;
pub use calendar::Calendar;
pub use event::Event;

View File

@@ -1,5 +1,5 @@
use crate::calendar::Calendar;
use crate::event::Event;
use crate::model::Calendar;
use crate::model::Event;
use crate::{CalendarStore, Error};
use anyhow::Result;
use async_trait::async_trait;

View File

@@ -2,7 +2,7 @@ use anyhow::Result;
use async_trait::async_trait;
use crate::error::Error;
use crate::{calendar::Calendar, event::Event};
use crate::model::{Calendar, Event};
#[async_trait]
pub trait CalendarStore: Send + Sync + 'static {

View File

@@ -26,7 +26,7 @@ async fn test_init<CS: CalendarStore>(_store: CS) {
#[tokio::test]
async fn test_create_event<CS: CalendarStore>(mut store: CS) {
store
.insert_calendar(rustical_store::calendar::Calendar {
.insert_calendar(rustical_store::model::Calendar {
id: "test".to_owned(),
displayname: Some("Test Calendar".to_owned()),
principal: "testuser".to_owned(),