1use iroh_blobs::net_protocol::Blobs;
2use iroh_docs::protocol::Docs;
3#[cfg(feature = "fuse")]
4use std::collections::HashMap;
5use std::path::PathBuf;
6#[cfg(feature = "fuse")]
7use std::sync::Arc;
8use std::sync::LazyLock;
9#[cfg(feature = "fuse")]
10use std::sync::RwLock;
11#[cfg(feature = "fuse")]
12use tokio::runtime::Handle;
13use tokio::sync::watch::Sender;
14
15pub mod core;
17pub mod directory;
19pub mod file;
21pub mod net;
23pub mod replica;
25pub mod util;
27
28pub const FS_PATH: &str = ".oku";
30pub(crate) static NODE_PATH: LazyLock<PathBuf> =
31 LazyLock::new(|| PathBuf::from(FS_PATH).join("node"));
32
33#[derive(Clone, Debug)]
37pub struct OkuFs {
38 pub(crate) endpoint: iroh::Endpoint,
39 pub(crate) blobs: Blobs<iroh_blobs::store::fs::Store>,
40 pub(crate) docs: Docs<iroh_blobs::store::fs::Store>,
41 pub(crate) router: iroh::protocol::Router,
42 pub replica_sender: Sender<()>,
45 pub okunet_fetch_sender: Sender<bool>,
47 #[cfg(feature = "fuse")]
48 pub(crate) fs_handles: Arc<RwLock<HashMap<u64, PathBuf>>>,
50 #[cfg(feature = "fuse")]
51 pub(crate) newest_handle: Arc<RwLock<u64>>,
53 #[cfg(feature = "fuse")]
54 pub(crate) handle: Handle,
56 pub(crate) dht: mainline::async_dht::AsyncDht,
57}