1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00
Files
go-chasquid-smtp/internal/queue/queue.proto
Alberto Bertogli 1fcc4ffe0f queue: Remove dependency on external protobuf package
The queue protobuf definition currently uses the well-known timestamp
protobuf package.

This adds a build-time dependency on it, which is fairly harmless when
building from source (since the golang protobuf compiler includes it
already), but adds overhead for packaging on distributions.

Since this is the only external proto dependency we have, and the
protobuf message itself is trivial, this patch removes it an instead
embeds a compatible definition.

That way we remove the dependency and simplify packaging, with almost
negligible code overhead.

The change is fully backwards compatible and has no functional changes.
2020-09-12 10:56:17 +01:00

59 lines
1.3 KiB
Protocol Buffer

syntax = "proto3";
package queue;
option go_package = "blitiri.com.ar/go/chasquid/internal/queue";
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 string To = 3;
repeated Recipient rcpt = 4;
bytes data = 5;
// Creation timestamp.
Timestamp created_at_ts = 6;
}
message Recipient {
// Address to send the message to.
// This is the final one, after expanding aliases.
string address = 1;
enum Type {
EMAIL = 0;
PIPE = 1;
}
Type type = 2;
enum Status {
PENDING = 0;
SENT = 1;
FAILED = 2;
}
Status status = 3;
string last_failure_message = 4;
// Address that this recipient was originally intended to.
// This is before expanding aliases and only used in very particular
// cases.
string original_address = 5;
}
// Timestamp representation, for convenience.
// We used to use the well-known type, but the dependency makes packaging much
// more convoluted and adds very little value, so we now just include it here.
message Timestamp {
// Represents seconds of UTC time since Unix epoch.
int64 seconds = 1;
// Non-negative fractions of a second at nanosecond resolution.
int32 nanos = 2;
}