queue: include send time in messages
This commit is contained in:
@@ -18,6 +18,9 @@ type Message struct {
|
||||
Channel string `json:"ch"`
|
||||
// Sender is an obfuscated identifier for the sending user.
|
||||
Sender sender `json:"u"`
|
||||
// Timestamp is the time at which the message was sent in nanoseconds since
|
||||
// the Unix epoch.
|
||||
Timestamp int64 `json:"ts"`
|
||||
// Text is the message content.
|
||||
Text string `json:"t"`
|
||||
}
|
||||
|
@@ -21,10 +21,11 @@ func (p *spyProducer) Produce(ctx context.Context, rec *kgo.Record, promise func
|
||||
|
||||
func TestSend(t *testing.T) {
|
||||
msg := queue.Message{
|
||||
ID: "bocchi",
|
||||
Channel: "kessoku",
|
||||
Sender: queue.Sender(make([]byte, 16), "kessoku", "ryō"),
|
||||
Text: "bocchi the rock!",
|
||||
ID: "bocchi",
|
||||
Channel: "kessoku",
|
||||
Sender: queue.Sender(make([]byte, 16), "kessoku", "ryō"),
|
||||
Timestamp: 1,
|
||||
Text: "bocchi the rock!",
|
||||
}
|
||||
var q spyProducer
|
||||
errs := make(chan error, 1)
|
||||
|
Reference in New Issue
Block a user