update API page
This commit is contained in:
parent
64c443fdab
commit
40b38517f8
74
src/API.md
74
src/API.md
|
@ -26,3 +26,77 @@ On base of password will be generted keypair for signing and keypair for encodin
|
|||
## Adding friends
|
||||
Each user have :w
|
||||
|
||||
----
|
||||
|
||||
# Requests
|
||||
``` Rust
|
||||
pub enum Request {
|
||||
StartApp,
|
||||
StopApp,
|
||||
LoadUsers,
|
||||
#[serde(rename_all = "camelCase")]
|
||||
SendMessage {
|
||||
user_id: Id,
|
||||
message: String,
|
||||
},
|
||||
#[serde(rename_all = "camelCase")]
|
||||
LoadMessages {
|
||||
user_id: Id,
|
||||
count: u32,
|
||||
start_index: u32,
|
||||
},
|
||||
#[serde(rename_all = "camelCase")]
|
||||
AddUser {
|
||||
name: String,
|
||||
sign_key: String,
|
||||
insert_key: String,
|
||||
}, // CreateInstance TODO v0.3
|
||||
}
|
||||
```
|
||||
## `StartApp`
|
||||
Require when when client started.
|
||||
``` json
|
||||
{
|
||||
type: "startApp"
|
||||
}
|
||||
```
|
||||
|
||||
## `StopApp`
|
||||
``` json
|
||||
{
|
||||
type: "stopApp"
|
||||
}
|
||||
```
|
||||
## `LoadUsers`
|
||||
``` json
|
||||
{
|
||||
type: "loadUsers"
|
||||
}
|
||||
```
|
||||
## `SendMessage`
|
||||
``` json
|
||||
{
|
||||
type: "sendMessage",
|
||||
userId: "UUID_V4...",
|
||||
message: "hellow world"
|
||||
}
|
||||
```
|
||||
## `AddUser`
|
||||
``` json
|
||||
{
|
||||
type: "addUser",
|
||||
name: "username",
|
||||
signKey: "USK@key...",
|
||||
insertKey: "insertkey..."
|
||||
}
|
||||
```
|
||||
## `LoadMessages`
|
||||
Requesting `count` messages from `userId` started from `startIndex`'s message
|
||||
``` json
|
||||
{
|
||||
type: "loadMessages",
|
||||
userId: "UUID_V4...",
|
||||
count: 10,
|
||||
startIndex: 30
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue