Start some docs

This commit is contained in:
Michael Zhang 2021-11-04 06:30:35 -05:00
parent 0f068bd3f9
commit 43811a6af9
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
11 changed files with 82 additions and 5 deletions

View file

@ -19,6 +19,7 @@ log = "0.4.14"
panorama-imap = { path = "../imap" } panorama-imap = { path = "../imap" }
panorama-smtp = { path = "../smtp" } panorama-smtp = { path = "../smtp" }
serde = { version = "1.0.130", features = ["derive"] } serde = { version = "1.0.130", features = ["derive"] }
session_types = "0.3.1"
stderrlog = "0.5.1" stderrlog = "0.5.1"
tokio = { version = "1.13.0", features = ["full"] } tokio = { version = "1.13.0", features = ["full"] }
tokio-rustls = "0.23.1" tokio-rustls = "0.23.1"
@ -26,7 +27,6 @@ toml = "0.5.8"
xdg = "2.4.0" xdg = "2.4.0"
notify = { version = "5.0.0-pre.13", optional = true } notify = { version = "5.0.0-pre.13", optional = true }
session_types = "0.3.1"
[dependencies.sqlx] [dependencies.sqlx]
version = "0.5.9" version = "0.5.9"

View file

@ -1,2 +0,0 @@
#[derive(Debug)]
pub enum MailEvent {}

View file

@ -1,6 +1,6 @@
#![allow(dead_code)] #![allow(dead_code)]
mod event; mod sessions;
mod store; mod store;
use anyhow::{Context, Result}; use anyhow::{Context, Result};
@ -18,7 +18,9 @@ use tokio::sync::mpsc::UnboundedSender;
use crate::config::{MailAccountConfig, TlsMethod}; use crate::config::{MailAccountConfig, TlsMethod};
pub use self::event::MailEvent; // pub use self::event::MailEvent;
#[derive(Debug)]
pub struct MailEvent;
pub use self::store::MailStore; pub use self::store::MailStore;
static MIGRATOR: Migrator = sqlx::migrate!(); static MIGRATOR: Migrator = sqlx::migrate!();

View file

@ -0,0 +1 @@
// TODO: figure out what sessions I actually want

1
docs/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
book

11
docs/SUMMARY.md Normal file
View file

@ -0,0 +1,11 @@
# Summary
- [Front](./front.md)
---
# Daemon
- [Daemon](./daemon/index.md)
- [API](./daemon/api.md)
- [Hooks](./daemon/hooks.md)

6
docs/book.toml Normal file
View file

@ -0,0 +1,6 @@
[book]
authors = ["Michael Zhang"]
language = "en"
multilingual = false
src = "."
title = "panorama"

33
docs/daemon/api.md Normal file
View file

@ -0,0 +1,33 @@
# Daemon API
To communicate with the daemon start by connecting to the socket it exposes.
This opens a long-lasting connection that can be used to send RPC messages. The
following messages are planned:
#### `mail::listen-receive`
```
(account : Option<String>) -> Stream<MessageNotification>
```
Begin subscribing to when mail is received for a particular account if provided,
or all accounts by default.
#### `mail::send`
```
(message : SendMessage) -> Result<()>
```
Send an email. If the send fails the result is returned immediately without
retry.
TODO: send with retry?
#### `mail::search`
```
(query : StructuredQuery) -> Result<SearchResultPage>
```
Search for messages, returns a summary of messages + first sentence.

1
docs/daemon/hooks.md Normal file
View file

@ -0,0 +1 @@
# Hooks

21
docs/daemon/index.md Normal file
View file

@ -0,0 +1,21 @@
# Daemon
The panorama daemon runs locally and serves as the primary controller of all of
panorama's functions. Since it needs to be ready to listen for clients at any
time, it should remain running in the background.
Planned functionality:
- Email
- Synchronizes with mail servers, aggregating a local database of messages.
- Build a comprehensive and full-text search index over all local messages.
- Send email by communicating with SMTP servers.
- Calendar
- Import ical files.
- Send reminders to various outputs.
Stretch goals:
- Email
- Expose a JMAP API, allowing other clients to connect to it.
- Massively configurable hooks.

3
docs/front.md Normal file
View file

@ -0,0 +1,3 @@
# Front