mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
rename Id to ID
This commit is contained in:
parent
13b10a693c
commit
9047d7f30d
@ -14,8 +14,8 @@ type Message struct {
|
||||
// instance - The underlying instance of the JS message object passed by the cloudflare
|
||||
instance js.Value
|
||||
|
||||
// Id - The unique Cloudflare-generated identifier of the message
|
||||
Id string
|
||||
// ID - The unique Cloudflare-generated identifier of the message
|
||||
ID string
|
||||
// Timestamp - The time when the message was enqueued
|
||||
Timestamp time.Time
|
||||
// Body - The message body. Could be accessed directly or using converting helpers as StringBody, BytesBody, IntBody, FloatBody.
|
||||
@ -32,7 +32,7 @@ func newMessage(obj js.Value) (*Message, error) {
|
||||
|
||||
return &Message{
|
||||
instance: obj,
|
||||
Id: obj.Get("id").String(),
|
||||
ID: obj.Get("id").String(),
|
||||
Body: obj.Get("body"),
|
||||
Attempts: obj.Get("attempts").Int(),
|
||||
Timestamp: timestamp,
|
||||
|
@ -29,8 +29,8 @@ func TestNewConsumerMessage(t *testing.T) {
|
||||
t.Fatalf("Body() = %v, want %v", body, "hello")
|
||||
}
|
||||
|
||||
if got.Id != id {
|
||||
t.Fatalf("Id = %v, want %v", got.Id, id)
|
||||
if got.ID != id {
|
||||
t.Fatalf("ID = %v, want %v", got.ID, id)
|
||||
}
|
||||
|
||||
if got.Attempts != 1 {
|
||||
|
@ -42,8 +42,8 @@ func TestNewConsumerMessageBatch(t *testing.T) {
|
||||
t.Fatalf("Body() = %v, want %v", body, "hello")
|
||||
}
|
||||
|
||||
if msg.Id != id {
|
||||
t.Fatalf("Id = %v, want %v", msg.Id, id)
|
||||
if msg.ID != id {
|
||||
t.Fatalf("ID = %v, want %v", msg.ID, id)
|
||||
}
|
||||
|
||||
if msg.Attempts != 1 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user