The code changes in `.gitignore` modify the exclusion rule for `go.sum` file, removing the `#` symbol to include it in version control. This change ensures that the `go.sum` file is tracked and synchronized across different environments, improving dependency management and ensuring consistent builds.
The code changes in `config.go` update the CNL pattern to correctly match CNL messages. This update ensures accurate extraction of data from CNL messages and improves the overall functionality of the code.
The code changes introduce a new `Index` field in the `FlightSchedule` struct and update the parsers in `aviation_parser.go` and `schedule_parser.go` to handle this field. This addition allows for the extraction and parsing of the `Index` value from flight schedule messages. The changes improve the functionality and accuracy of the code when working with flight schedules.
refactor: Add schedule_parser.go and schedule_parser_test.go
The code changes introduce a new `schedule_parser.go` file and its corresponding test file `schedule_parser_test.go`. These files contain the implementation and tests for the `FindWaypoints` function, which extracts waypoints from a given message. This addition enhances the functionality of the code by providing a way to parse and retrieve specific information from messages.
The code changes in `pln.go` introduce a new `FlightSchedule` struct and validation logic. This struct represents a flight schedule and includes various fields such as date, category, flight number, aircraft registration, passenger configuration, ILS category, departure airport, departure time, schedule info, arrival time, arrival airport, comments, and reference. The `Validate` method ensures that the required fields are populated and returns an error if any field is missing. This addition improves the overall functionality and data integrity of the code.
Update go.mod dependencies to the latest stable versions. This includes updating github.com/nats-io/nats.go to v1.36.0, github.com/onsi/ginkgo/v2 to v2.19.1, github.com/onsi/gomega to v1.34.0, go.uber.org/zap to v1.27.0, and golang.org/x/oauth2 to v0.21.0. Also update github.com/go-logr/logr to v1.4.2 and github.com/klauspost/compress to v1.17.9. These updates ensure that the project is using the most recent dependencies, improving stability and compatibility.
The code changes in `aviation_parser.go` and `aviation_parser_test.go` enhance the CNL message parsing logic in the `BodyParser` module. This ensures accurate extraction of data from CNL messages, including the category, aircraft ID, departure airport, and destination airport. The improvements improve the overall functionality and accuracy of the code.
The code changes in `config.go` update the CNL pattern to correctly match CNL messages. The previous pattern did not properly capture the arrival location, resulting in incorrect parsing of CNL messages. This update ensures accurate extraction of data from CNL messages and improves the overall functionality of the code.
The code changes in `aviation_parser.go` and `aviation_parser_test.go` add CNL message parsing logic to the `BodyParser` module. This allows for the correct extraction and parsing of CNL messages, including the category, aircraft ID, departure airport, and destination airport. This enhancement improves the overall functionality and accuracy of the code.
The code changes in `aviation_parser.go` modify the `NewBodyParser` constructor to accept a `body` parameter. This allows for the initialization of `BodyParser` instances with a specific body value, improving flexibility and testability. The `body` parameter is now stored in the `body` field of the `BodyParser` struct. This change enhances the overall functionality and maintainability of the code.
The code changes in `pattern_test.go` update the ARR body parsing logic. The message body parsing now correctly handles ARR bodies with a different pattern format. This ensures accurate extraction of data based on patterns and improves the overall functionality of the code.
group of more than one alternative in fpl
This commit updates the `log.go` file to improve the initialization and configuration of the logger. The code changes remove unnecessary comments and unused variables, ensuring cleaner and more efficient code. Additionally, the `load` function is modified to properly handle errors when loading the logger configuration file. These improvements enhance the overall functionality and maintainability of the logger module.
The code changes in `aviation_parser.go` and `aviation_parser_test.go` rename the `clean` function to `cleanMessage` to improve clarity and consistency in function naming. This change ensures that the function's purpose is more accurately reflected in its name, making it easier for developers to understand and maintain the code.
The code changes in `pattern_test.go` update the ARR body parsing logic. The message body parsing now correctly handles ARR bodies with a different pattern format. This ensures accurate extraction of data based on patterns and improves the overall functionality of the code.
This commit updates the go.mod file to include the latest versions of the following dependencies:
- github.com/Khan/genqlient v0.7.0
- github.com/google/uuid v1.6.0
These updates ensure that the project is using the most recent and stable versions of the dependencies, improving the overall reliability and functionality of the code.
The code changes in `pattern_test.go` update the ARR body parsing logic. The message body parsing now correctly handles ARR bodies with a different pattern format. This ensures accurate extraction of data based on patterns and improves the overall functionality of the code.
The code changes in config.dev.toml and sub.go update the configuration and message handling for integrating with Hasura. The config.dev.toml file now includes a new section for Hasura configuration, specifying the endpoint and secret. In sub.go, the UUID field is set to the UUID of the received message, ensuring proper tracking of parsed messages. This refactor enables seamless integration with Hasura and improves the functionality of the code.
The code changes in fpl.go update the Flight Plan (FPL) structure fields. The FlightNumber, AircraftID, SSRModeAndCode, CruisingSpeedAndLevel, DepartureAirport, DepartureTime, Route, DestinationAndTotalTime, AlternateAirport, EstimatedArrivalTime, SELCALCode, and EstimatedElapsedTime fields are modified to reflect the new values. This refactor ensures accurate representation of the FPL data and improves the overall functionality of the code.
The code changes in `aviation_parser_test.go` update the ARR body parsing logic. The `ParseHeader` function now correctly handles ARR bodies with optional time components. This ensures accurate parsing of ARR bodies and improves the overall functionality of the aviation parser.
The code changes in aviation_parser.go refactor the clean function to improve its functionality. The changes include updating variable names for clarity and handling the case where the bodyOnly match is empty. This refactor enhances the cleanliness and readability of the code.
The code changes in `aviation_parser_test.go` update the ARR body parsing logic. The `ParseHeader` function now correctly handles ARR bodies with optional time components. This ensures accurate parsing of ARR bodies and improves the overall functionality of the aviation parser.
The code changes in `config.go` update the regular expression pattern for parsing ARR bodies. The previous pattern did not account for the optional time component in the body. The updated pattern now correctly captures the category, number, SSR, departure, arrival, and time components of the ARR body. This refactor ensures accurate parsing of ARR bodies and improves the overall functionality of the aviation parser.
The code changes in `main.go` update the NATS subscription logic and configuration. The `Subscribe` function now uses the `NatsHandler` struct to handle the subscription. The `NewNatsHandler` function is added to create a new instance of the `NatsHandler` with the provided configuration. The configuration values are passed to the `NatsSubscriber` constructor to set up the NATS subscription. This refactor improves the modularity and readability of the NATS subscription code.
The code changes remove the unused fields in the `aviation.go` file, specifically the `CallSign`, `FlightPlanID`, `Route`, `Altitude`, `Speed`, `Position`, `EmergencyIndicator`, `ReportType`, `SupplementaryInfo`, `FilingTime`, `OriginatorIndicator`, `ServiceInformation`, and `NavigationAidInfo` fields. These fields were no longer needed and were causing unnecessary clutter in the codebase. This refactor improves code cleanliness and maintainability.
The code changes in `aviation_parser_test.go` update the AFTN message parsing logic. The `ParseHeader` function now returns an additional error value, allowing for better error handling. The tests have been updated to reflect this change, ensuring that the parsing function handles errors correctly. This refactor improves the reliability and maintainability of the AFTN message parsing functionality.
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.
The code changes in `aviation_parser_test.go` update the AFTN message parsing logic. The `ParseHeader` function now returns an additional error value, allowing for better error handling. The tests have been updated to reflect this change, ensuring that the parsing function handles errors correctly. This refactor improves the reliability and maintainability of the AFTN message parsing functionality.
The code changes rename the "Text" field in the AFTN struct to "Body" to improve clarity and consistency. This change aligns with the naming convention used in other parts of the codebase and enhances code readability.
The code changes remove the unused `SurveillanceEquipment` field in the `FPL` struct and the `TelegramCategory` field in the `DEP` struct. These fields are no longer needed and can be safely removed. This commit improves code cleanliness and reduces unnecessary complexity.
The code changes in `config.go` remove the commented code for printing a validation message and update the fields of the `FPL` struct in `fpl_test.go`. The commented code is no longer needed and can be safely removed. The updated fields in the `FPL` struct reflect the latest requirements and improve the accuracy of the test cases. This commit enhances code readability and maintainability.
The regex patterns used for parsing flight plans have been updated in the `config.go` file. The changes include adding named capture groups for each segment of the flight plan string, allowing for easier extraction of specific information. This update improves the accuracy and flexibility of the flight plan parsing functionality.
The main receiver file path in the Makefile has been updated to `./cmd/main/main.go` to reflect the correct location of the file. This change ensures that the Makefile correctly builds and runs the main receiver component of the application.
This commit adds functionality to parse FPL messages in the `aftn_parser.go` file. The `Parse` method now correctly parses the FPL message type and extracts the relevant data fields. The `FPL` struct is introduced in the `domain` package to represent FPL messages. The parsing logic is implemented to populate the `FPL` struct with the parsed data. This change enables the application to handle FPL messages and process them accordingly.
This commit adds functionality to parse AFTN messages in the `aftn_parser.go` file. The `Parse` method now correctly parses the message based on its type and extracts the relevant data. Additionally, the `FindPatterns` and `ParseBody` functions have been updated to remove the dependency on the `config` package and instead use the `config.GetBodyPatterns` function to retrieve the body patterns. This change improves the modularity and maintainability of the code.
Note: This commit message assumes that the `config` package has been refactored to use the `GetBodyPatterns` function.