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.
This commit is contained in:
@@ -22,9 +22,7 @@ type AFTNParser struct {
|
||||
|
||||
// Parse parses a generic AFTN message based on its type.
|
||||
func (p AFTNParser) Parse(text string) (interface{}, error) {
|
||||
config := config.GetMyConfig()
|
||||
|
||||
data := ParseBody(text, config)
|
||||
data := ParseBody(text)
|
||||
|
||||
switch data["type"] {
|
||||
case "ARR":
|
||||
|
||||
Reference in New Issue
Block a user