Commit Graph
33 Commits
Author SHA1 Message Date
windyboy 77a7c7eae0 refactor: Update ARR body parsing logic 2024-07-23 11:29:12 +08:00
windyboy 3202521f7b refactor: Update NATS subscription logic and configuration 2024-07-22 18:00:51 +08:00
windyboy 53f03bbc0a refactor: Update config.dev.toml and sub.go for Hasura integration
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.
2024-07-22 16:23:15 +08:00
windyboy 3115162454 refactor: Update ARR body parsing logic 2024-07-22 14:43:35 +08:00
windyboy 25bb5aa404 refactor: Update FPL structure fields in fpl.go
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.
2024-07-22 12:42:42 +08:00
windyboy 0391f9f481 refactor: Update ARR body parsing logic
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.
2024-07-22 12:42:30 +08:00
windyboy c72b6e2163 refactor: Update ARR body parsing logic 2024-07-22 08:51:23 +08:00
windyboy bfba859630 refactor: Improve clean function in aviation_parser.go
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.
2024-07-22 08:49:21 +08:00
windyboy 57fdd5fe28 refactor: Update regular expression pattern for FPL body parsing 2024-07-22 08:26:52 +08:00
windyboy 12b1b47d96 refactor: Update ARR body parsing logic
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.
2024-07-22 08:12:18 +08:00
windyboy 497a33a99a refactor: Update regular expression pattern for ARR body parsing
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.
2024-07-22 00:01:27 +08:00
windyboy 24c9beeb13 refactor: Update NATS subscription logic and configuration
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.
2024-07-21 23:09:29 +08:00
windyboy 29fecbbe6c refactor: Remove unused fields in aviation domain structs 2024-07-21 13:42:25 +08:00
windyboy 29f41f1be5 refactor: Remove unused fields in aviation domain structs
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.
2024-07-21 13:36:15 +08:00
windyboy b22eaa4017 refactor: Update AFTN message parsing logic 2024-07-21 13:33:57 +08:00
windyboy 607518b677 refactor: Update AFTN message parsing logic 2024-07-21 00:25:16 +08:00
windyboy e8be157bd3 refactor: Update AFTN message parsing logic
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.
2024-07-20 22:33:22 +08:00
windyboy 135ef12c4d ```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.
2024-07-20 22:25:28 +08:00
windyboy 2b83d9b785 refactor: Update AFTN message parsing logic 2024-07-20 22:21:12 +08:00
windyboy 6f69a56168 refactor: Update AFTN message parsing logic 2024-07-20 18:57:13 +08:00
windyboy b9e021d3ab refactor: Update AFTN message parsing logic
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.
2024-07-20 18:55:28 +08:00
windyboy 4bb79e92dd refactor: Rename AFTN struct field from "Text" to "Body" 2024-07-20 18:26:17 +08:00
windyboy d4eabd42e4 refactor: Rename AFTN struct field from "Text" to "Body"
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.
2024-07-20 12:37:18 +08:00
windyboy 74c3768e27 chore: Remove unused fields in FPL and DEP structs 2024-07-20 10:41:43 +08:00
windyboy 242e48d1b7 chore: Remove unused fields in FPL and DEP structs
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.
2024-07-20 10:40:28 +08:00
windyboy e394362554 chore: Remove commented code and update FPL struct fields
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.
2024-07-20 08:21:49 +08:00
windyboy 75160df8ca feat: Update regex patterns for flight plan parsing
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.
2024-07-20 01:17:58 +08:00
windyboy a5a2ced556 feat: Update main receiver file path in Makefile
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.
2024-07-20 00:52:31 +08:00
windyboy afd4643696 feat: Add FPL message parsing functionality
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.
2024-07-20 00:46:31 +08:00
windyboy 969bb57902 feat: Add AFTN message parsing functionality
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.
2024-07-20 00:01:04 +08:00
windyboy dbbf6133be init 2024-07-19 20:02:18 +08:00
windyboy d1d427057e chore: Add .gitignore file to project 2024-07-19 20:02:03 +08:00
windyboy ee2cdb4b04 Initial commit 2024-07-19 20:00:10 +08:00