1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

queue: Implement persistency

This patch makes the queue read and write items to disk.

It uses protobuf for serialization. We serialize to text format to make
manual troubleshooting easier, as the performance difference is not very
relevant for us.
This commit is contained in:
Alberto Bertogli
2016-09-18 06:13:42 +01:00
parent 9ed30a747b
commit aacf8ffea7
11 changed files with 457 additions and 64 deletions

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
package queue;
import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";
message Message {
// Message ID. Uniquely identifies this message, it is used for
// auditing and troubleshooting.
string ID = 1;
// The envelope for this message.
string from = 2;
repeated Recipient rcpt = 3;
bytes data = 4;
// Creation timestamp.
google.protobuf.Timestamp created_at_ts = 5;
}
message Recipient {
string address = 1;
enum Type {
EMAIL = 0;
}
Type type = 2;
enum Status {
PENDING = 0;
SENT = 1;
FAILED = 2;
}
Status status = 3;
}