panorama/docs/daemon/api.md

57 lines
1.2 KiB
Markdown
Raw Normal View History

2021-11-04 11:30:35 +00:00
# Daemon API
To communicate with the daemon start by connecting to the socket it exposes.
2021-11-04 17:29:07 +00:00
This opens a long-lasting connection that can be used to send RPC messages.
## Authentication
If connecting over a network rather than a socket, the client should
authenticate in order to talk to panorama at all. The framework for this is _TLS
client authentication_.
### Namespace `panorama::auth`
TODO:
## Standard API
2021-11-04 11:30:35 +00:00
2021-11-04 11:37:42 +00:00
### Namespace `panorama::mail`
#### `listen-receive`
2021-11-04 11:30:35 +00:00
```
(account : Option<String>) -> Stream<MessageNotification>
```
Begin subscribing to when mail is received for a particular account if provided,
or all accounts by default.
2021-11-04 11:37:42 +00:00
#### `send`
2021-11-04 11:30:35 +00:00
```
(message : SendMessage) -> Result<()>
```
Send an email. If the send fails the result is returned immediately without
retry.
TODO: send with retry?
2021-11-04 11:37:42 +00:00
#### `search`
2021-11-04 11:30:35 +00:00
```
(query : StructuredQuery) -> Result<SearchResultPage>
```
Search for messages, returns a summary of messages + first sentence.
2021-11-04 17:29:07 +00:00
## Extensions
Since extensions may be separate processes, they must also communicate with the
daemon, but since the daemon is responsible for launching them, they don't have
to connect to the socket explicitly.
### Namespace `panorama::extensions`