services

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL