dittolive-ditto 4.0.0-beta1

Ditto is a peer to peer cross-platform database that allows mobile, web, IoT and server apps to sync with or without an internet connection.
Documentation
use crate::prelude::{identity, Ditto, DittoError, LogLevel};

pub fn setup_ditto() -> Result<Ditto, DittoError> {
    let ditto = Ditto::builder()
        .with_temp_dir()
        .with_identity(|ditto_root| identity::OfflinePlayground::random(ditto_root))?
        .with_minimum_log_level(LogLevel::Error)
        .build()?;
    ditto.set_license_from_env("DITTO_LICENSE")?;
    Ok(ditto)
}