chengxilo commented on code in PR #1904:
URL: https://github.com/apache/iggy/pull/1904#discussion_r2164004076
##########
foreign/go/contracts/message_header.go:
##########
@@ -21,23 +21,21 @@ import (
"encoding/binary"
"errors"
"time"
-
- "github.com/google/uuid"
)
const MessageHeaderSize = 8 + 16 + 8 + 8 + 8 + 4 + 4
type MessageHeader struct {
- Checksum uint64 `json:"checksum"`
- Id uuid.UUID `json:"id"`
- Offset uint64 `json:"offset"`
- Timestamp uint64 `json:"timestamp"`
- OriginTimestamp uint64 `json:"origin_timestamp"`
- UserHeaderLength uint32 `json:"user_header_length"`
- PayloadLength uint32 `json:"payload_length"`
+ Checksum uint64 `json:"checksum"`
+ Id [16]byte `json:"id"`
Review Comment:
Actually when using UUID as MessageID, we can just use it like this:
```golang
u, _ := uuid.New()
id := MessageID(u)
```
So I guess we don't need a MessageIDFromUUID method.
I spend a pretty long time to think whether I should use the [16]byte
actually, since with [16]byte we can avoid doing the convert. But according to
your opinion and other developer I communicated with, I think most developer
would support using custom type. Thus I will update the code so we use
MessageID as type instead of [16]byte.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]