initial livekit support

fix up code

undo changes to compose file

add back .env.example
This commit is contained in:
Zomatree
2024-04-09 21:21:52 +01:00
parent 7703475868
commit ad0dcad497
26 changed files with 2397 additions and 1334 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ pub enum DatabaseInfo {
}
/// Database
#[derive(Clone)]
#[derive(Clone, Debug)]
pub enum Database {
/// Mock database
Reference(ReferenceDb),
@@ -35,7 +35,7 @@ impl DatabaseInfo {
#[async_recursion]
pub async fn connect(self) -> Result<Database, String> {
let config = config().await;
println!("{config:?}");
Ok(match self {
DatabaseInfo::Auto => {
if std::env::var("TEST_DB").is_ok() {
@@ -12,6 +12,7 @@ use serde::Serialize;
database_derived!(
#[cfg(feature = "mongodb")]
/// MongoDB implementation
#[derive(Debug)]
pub struct MongoDb(pub ::mongodb::Client, pub String);
);
@@ -10,7 +10,7 @@ use crate::{
database_derived!(
/// Reference implementation
#[derive(Default)]
#[derive(Default, Debug)]
pub struct ReferenceDb {
pub bots: Arc<Mutex<HashMap<String, Bot>>>,
pub channels: Arc<Mutex<HashMap<String, Channel>>>,