use iroh::client::Iroh;
use iroh::node::FsNode;
#[cfg(feature = "fuse")]
use std::collections::HashMap;
use std::path::PathBuf;
#[cfg(feature = "fuse")]
use std::sync::Arc;
use std::sync::LazyLock;
#[cfg(feature = "fuse")]
use std::sync::RwLock;
#[cfg(feature = "fuse")]
use tokio::runtime::Handle;
use tokio::sync::watch::Sender;
mod core;
mod directory;
mod file;
mod net;
mod replica;
mod util;
#[allow(unused_imports)]
pub use self::core::*;
#[allow(unused_imports)]
pub use self::directory::*;
#[allow(unused_imports)]
pub use self::file::*;
#[allow(unused_imports)]
pub use self::net::*;
#[allow(unused_imports)]
pub use self::replica::*;
#[allow(unused_imports)]
pub use self::util::*;
pub const FS_PATH: &str = ".oku";
pub(crate) static NODE_PATH: LazyLock<PathBuf> =
LazyLock::new(|| PathBuf::from(FS_PATH).join("node"));
#[derive(Clone, Debug)]
pub struct OkuFs {
running_node: Option<FsNode>,
pub(crate) node: Iroh,
pub replica_sender: Sender<()>,
#[cfg(feature = "fuse")]
pub(crate) fs_handles: Arc<RwLock<HashMap<u64, PathBuf>>>,
#[cfg(feature = "fuse")]
pub(crate) newest_handle: Arc<RwLock<u64>>,
#[cfg(feature = "fuse")]
pub(crate) handle: Handle,
pub(crate) dht: mainline::async_dht::AsyncDht,
}