status-go/services/mailservers
Andrea Maria Piana b27779aa4e
Add Mailserver Request Gaps service (#1596)
This commits add some endpoints to store mailserver request gaps,
and provides 4 endpoints:

```
AddMailserverRequestGaps(gaps []MailserverRequestGap) error
GetMailserverRequestGaps(chatID string) []MailserverRequestGap
DeleteMailserverRequestGaps(ids []string) error
DeleteMailserverRequestGapsByChatID(id string) error
```
2019-09-04 12:04:17 +02:00
..
README.md Add Mailserver Request Gaps service (#1596) 2019-09-04 12:04:17 +02:00
api.go Add Mailserver Request Gaps service (#1596) 2019-09-04 12:04:17 +02:00
api_test.go Add Mailserver Request Gaps service (#1596) 2019-09-04 12:04:17 +02:00
database.go Add Mailserver Request Gaps service (#1596) 2019-09-04 12:04:17 +02:00
service.go Add mailservers service (#1595) 2019-09-04 08:25:33 +02:00

README.md

Mailservers Service

Mailservers service provides read/write API for Mailserver object which stores details about user's mailservers.

To enable this service, include mailservers in APIModules:

{
  "MailserversConfig": {
    "Enabled": true
  },
  "APIModules": "mailservers"
}

API

Enabling service will expose three additional methods:

mailservers_addMailserver

Stores Mailserver in the database. All fields are specified below:

{
  "id": "1",
  "name": "my mailserver",
  "address": "enode://...",
  "password": "some-pass",
  "fleet": "beta"
}

mailservers_getMailservers

Reads all saved mailservers.

mailservers_deleteMailserver

Deletes a mailserver specified by an ID.

Mailserver requests gap service

Mailserver request gaps service provides read/write API for MailserverRequestGap object which stores details about the gaps between mailserver requests.

API

The service exposes four methods

mailserverrequestgaps_addMailserverRequestGaps

Stores MailserverRequestGap in the database. All fields are specified below:

{
  "id": "1",
  "chatId": "chat-id",
  "from": 1,
  "to": 2
}

mailservers_getMailserverRequestGaps

Reads all saved mailserver request gaps by chatID.

mailservers_deleteMailserverRequestGaps

Deletes all MailserverRequestGaps specified by IDs.

mailservers_deleteMailserverRequestGapsByChatID

Deletes all MailserverRequestGaps specified by chatID.