rename Id to ID

This commit is contained in:
syumai 2025-01-15 21:13:20 +09:00
parent 13b10a693c
commit 9047d7f30d
3 changed files with 7 additions and 7 deletions

View File

@ -14,8 +14,8 @@ type Message struct {
// instance - The underlying instance of the JS message object passed by the cloudflare // instance - The underlying instance of the JS message object passed by the cloudflare
instance js.Value instance js.Value
// Id - The unique Cloudflare-generated identifier of the message // ID - The unique Cloudflare-generated identifier of the message
Id string ID string
// Timestamp - The time when the message was enqueued // Timestamp - The time when the message was enqueued
Timestamp time.Time Timestamp time.Time
// Body - The message body. Could be accessed directly or using converting helpers as StringBody, BytesBody, IntBody, FloatBody. // 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{ return &Message{
instance: obj, instance: obj,
Id: obj.Get("id").String(), ID: obj.Get("id").String(),
Body: obj.Get("body"), Body: obj.Get("body"),
Attempts: obj.Get("attempts").Int(), Attempts: obj.Get("attempts").Int(),
Timestamp: timestamp, Timestamp: timestamp,

View File

@ -29,8 +29,8 @@ func TestNewConsumerMessage(t *testing.T) {
t.Fatalf("Body() = %v, want %v", body, "hello") t.Fatalf("Body() = %v, want %v", body, "hello")
} }
if got.Id != id { if got.ID != id {
t.Fatalf("Id = %v, want %v", got.Id, id) t.Fatalf("ID = %v, want %v", got.ID, id)
} }
if got.Attempts != 1 { if got.Attempts != 1 {

View File

@ -42,8 +42,8 @@ func TestNewConsumerMessageBatch(t *testing.T) {
t.Fatalf("Body() = %v, want %v", body, "hello") t.Fatalf("Body() = %v, want %v", body, "hello")
} }
if msg.Id != id { if msg.ID != id {
t.Fatalf("Id = %v, want %v", msg.Id, id) t.Fatalf("ID = %v, want %v", msg.ID, id)
} }
if msg.Attempts != 1 { if msg.Attempts != 1 {