refactor parser packages
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
package parser
|
||||
|
||||
import (
|
||||
"caatsm/internal/adapter/dto"
|
||||
"caatsm/internal/adapter/parser/aviation"
|
||||
"caatsm/internal/port"
|
||||
)
|
||||
|
||||
// AviationParser implements the Parser interface
|
||||
type AviationParser struct{}
|
||||
|
||||
// Parse parses a raw message string and returns a ParsedTelegram
|
||||
func (p *AviationParser) Parse(rawText string) (*dto.ParsedTelegram, error) {
|
||||
return Parse(rawText)
|
||||
}
|
||||
|
||||
// ProvideParser creates a composite parser instance that combines weather and aviation parsers
|
||||
// ProvideParser creates a composite parser instance that combines weather and aviation parsers.
|
||||
func ProvideParser(weatherParser port.WeatherParser) Parser {
|
||||
aviation := &AviationParser{}
|
||||
return NewCompositeParser(aviation, weatherParser)
|
||||
aviationParser := aviation.NewParser()
|
||||
return NewCompositeParser(aviationParser, weatherParser)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user