Add TED Scraper Configuration and Cron Scheduler Implementation

- Introduced a new configuration file for the TED scraper, defining database connection settings, logging preferences, and scraping parameters.
- Implemented a CronScheduler to manage scheduled tasks for TED operations, utilizing the robfig/cron library for scheduling.
- Added new entities and structures for handling TED XML data, including eForms and tender-related information, enhancing the scraper's functionality.
- Updated the main application to initialize the TED scraper with the new configuration and set up graceful shutdown handling.
- Removed the deprecated scraping implementation to streamline the codebase and focus on the new architecture.
This commit is contained in:
n.nakhostin
2025-09-30 16:03:53 +03:30
parent 0c50935c42
commit 05c7eae8a2
36 changed files with 3427 additions and 311 deletions
+71
View File
@@ -0,0 +1,71 @@
package eform
import "encoding/xml"
// =====================================================
// UBL EXTENSIONS
// =====================================================
// UBLExtensions represents the UBL extensions element
type UBLExtensions struct {
UBLExtension []UBLExtension `json:"ubl_extension,omitempty" xml:"UBLExtension,omitempty"`
}
// UBLExtension represents a single UBL extension
type UBLExtension struct {
ExtensionContent ExtensionContent `json:"extension_content,omitempty" xml:"ExtensionContent,omitempty"`
}
// ExtensionContent represents the extension content
type ExtensionContent struct {
EformsExtension EformsExtension `json:"eforms_extension,omitempty" xml:"EformsExtension,omitempty"`
}
// EformsExtension represents the eforms extension data
type EformsExtension struct {
NoticeSubType NoticeSubType `json:"notice_sub_type,omitempty" xml:"NoticeSubType,omitempty"`
Organizations Organizations `json:"organizations,omitempty" xml:"Organizations,omitempty"`
Publication Publication `json:"publication,omitempty" xml:"Publication,omitempty"`
SelectionCriteria []SelectionCriteria `json:"selection_criteria,omitempty" xml:"SelectionCriteria,omitempty"`
OfficialLanguages OfficialLanguages `json:"official_languages,omitempty" xml:"OfficialLanguages,omitempty"`
}
// NoticeSubType represents the notice subtype
type NoticeSubType struct {
XMLName xml.Name `xml:"NoticeSubType"`
SubTypeCode string `xml:"SubTypeCode"`
}
// Organizations represents the organizations element
type Organizations struct {
XMLName xml.Name `xml:"Organizations"`
Organization []Organization `xml:"Organization,omitempty"`
}
// Publication represents the publication information
type Publication struct {
XMLName xml.Name `xml:"Publication"`
NoticePublicationID string `xml:"NoticePublicationID"`
GazetteID string `xml:"GazetteID"`
PublicationDate string `xml:"PublicationDate"`
}
// SelectionCriteria represents selection criteria for tenderers
type SelectionCriteria struct {
XMLName xml.Name `xml:"SelectionCriteria"`
TendererRequirementTypeCode string `xml:"TendererRequirementTypeCode"`
Description string `xml:"Description,omitempty"`
SecondStageIndicator bool `xml:"SecondStageIndicator,omitempty"`
}
// OfficialLanguages represents official languages for the tender
type OfficialLanguages struct {
XMLName xml.Name `xml:"OfficialLanguages"`
Language []Language `xml:"Language,omitempty"`
}
// Language represents a language code
type Language struct {
XMLName xml.Name `xml:"Language"`
ID string `xml:"ID"`
}