Documentation
¶
Index ¶
- type ConversionService
- func (s *ConversionService) Convert(sourceData []byte, sourcePlatform, targetPlatform models.PlatformType) ([]byte, error)
- func (s *ConversionService) ConvertWithContext(ctx context.Context, sourceData []byte, ...) ([]byte, error)
- func (s *ConversionService) ValidateSourceData(data []byte, platform models.PlatformType) error
- func (s *ConversionService) ValidateTargetCompatibility(unifiedDSL *models.UnifiedDSL, platform models.PlatformType) error
- type PlatformStrategy
- type StrategyRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversionService ¶
type ConversionService struct {
// contains filtered or unexported fields
}
ConversionService orchestrates DSL conversion between platforms.
func NewConversionService ¶
func NewConversionService(registry StrategyRegistry) *ConversionService
NewConversionService creates a conversion service with the provided strategy registry.
func (*ConversionService) Convert ¶
func (s *ConversionService) Convert( sourceData []byte, sourcePlatform, targetPlatform models.PlatformType, ) ([]byte, error)
Convert performs DSL conversion from source to target format.
func (*ConversionService) ConvertWithContext ¶
func (s *ConversionService) ConvertWithContext( ctx context.Context, sourceData []byte, sourcePlatform, targetPlatform models.PlatformType, ) ([]byte, error)
ConvertWithContext performs DSL conversion with request context support.
func (*ConversionService) ValidateSourceData ¶
func (s *ConversionService) ValidateSourceData( data []byte, platform models.PlatformType, ) error
ValidateSourceData validates input data against source platform requirements.
func (*ConversionService) ValidateTargetCompatibility ¶
func (s *ConversionService) ValidateTargetCompatibility( unifiedDSL *models.UnifiedDSL, platform models.PlatformType, ) error
ValidateTargetCompatibility verifies unified DSL compatibility with target platform.
type PlatformStrategy ¶
type PlatformStrategy interface {
// GetPlatformType returns the platform identifier
GetPlatformType() models.PlatformType
// CreateParser creates a DSL parser for this platform
CreateParser() (interfaces.DSLParser, error)
// CreateGenerator creates a DSL generator for this platform
CreateGenerator() (interfaces.DSLGenerator, error)
}
PlatformStrategy defines the interface for platform-specific conversion strategies. Simplified to include only the methods that are actually used.
type StrategyRegistry ¶
type StrategyRegistry interface {
// GetStrategy retrieves the strategy for the specified platform
GetStrategy(platform models.PlatformType) (PlatformStrategy, error)
// RegisterStrategy registers a strategy for a platform
RegisterStrategy(platform models.PlatformType, strategy PlatformStrategy)
// GetSupportedPlatforms returns list of supported platforms
GetSupportedPlatforms() []models.PlatformType
}
StrategyRegistry manages platform-specific conversion strategies.