mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-22 15:27:02 +00:00
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.
This commit is contained in:
@@ -4,9 +4,6 @@ syntax = "proto3";
|
||||
package queue;
|
||||
option go_package = "blitiri.com.ar/go/chasquid/internal/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.
|
||||
@@ -19,7 +16,7 @@ message Message {
|
||||
bytes data = 5;
|
||||
|
||||
// Creation timestamp.
|
||||
google.protobuf.Timestamp created_at_ts = 6;
|
||||
Timestamp created_at_ts = 6;
|
||||
}
|
||||
|
||||
message Recipient {
|
||||
@@ -48,3 +45,14 @@ message Recipient {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user