```text
feat: Add timestamp fields to ParsedMessage struct The code changes in `aviation_parser.go` add the `ParsedAt` and `ReceivedAt` fields to the `ParsedMessage` struct. These fields store the timestamps when the message was parsed and received, respectively. This enhancement provides valuable information for tracking and analyzing message processing times.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"errors" // Import errors package to handle errors
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -115,6 +116,7 @@ func Parse(rawText string) (*domain.ParsedMessage, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
message.ParsedAt = time.Now()
|
||||
message.BodyData = bodyData
|
||||
return &message, nil
|
||||
}
|
||||
@@ -150,6 +152,7 @@ func ParseHeader(fullMessage string) (domain.ParsedMessage, error) {
|
||||
Originator: originator,
|
||||
OriginatorDateTime: originatorDateTime,
|
||||
BodyAndFooter: bodyAndFooter,
|
||||
ReceivedAt: time.Now(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user