Documentation
¶
Index ¶
- type ConversionOptions
- type DebugOptions
- type PDFGenerationOptions
- type PDFGenerationRequest
- type PDFGenerationResult
- type PDFGenerationService
- type PDFMetadata
- type PDFValidator
- type TemplateProcessingService
- type TemplateVariables
- func (tv *TemplateVariables) Clone() *TemplateVariables
- func (tv *TemplateVariables) Flatten() map[string]string
- func (tv *TemplateVariables) Get(key string) (config.Variable, bool)
- func (tv *TemplateVariables) GetString(key string) (string, bool)
- func (tv *TemplateVariables) IsEmpty() bool
- func (tv *TemplateVariables) Keys() []string
- func (tv *TemplateVariables) Len() int
- func (tv *TemplateVariables) Merge(other *TemplateVariables)
- func (tv *TemplateVariables) Set(key string, value config.Variable)
- func (tv *TemplateVariables) SetString(key string, value string) error
- func (tv *TemplateVariables) ToMap() map[string]interface{}
- func (tv *TemplateVariables) Validate() error
- type VariableResolver
- type WatchInstanceInfo
- type WatchModeManager
- type WatchService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversionOptions ¶
ConversionOptions contains settings for PDF to image conversion
type DebugOptions ¶ added in v1.2.2
type DebugOptions struct {
Enabled bool
LogToFile bool
LogFilePath string
CreateConcreteFile bool
RequestID string
}
DebugOptions contains debug-specific settings
type PDFGenerationOptions ¶
type PDFGenerationOptions struct {
DoConvert bool
DoClean bool
Conversion ConversionOptions
Timeout time.Duration
Verbose int
Debug DebugOptions
Force bool
RequestID string // For unique file naming
WatchMode bool // Enable file watching for automatic rebuilds
}
PDFGenerationOptions contains optional settings for PDF generation
type PDFGenerationRequest ¶
type PDFGenerationRequest struct {
TemplatePath string
Variables *TemplateVariables
Engine string
OutputPath string
Options PDFGenerationOptions
}
PDFGenerationRequest represents a request to generate a PDF
type PDFGenerationResult ¶
type PDFGenerationResult struct {
PDFPath string
ImagePaths []string
Success bool
Error error
Metadata PDFMetadata
}
PDFGenerationResult represents the result of PDF generation
type PDFGenerationService ¶
type PDFGenerationService interface {
Generate(ctx context.Context, req PDFGenerationRequest) (PDFGenerationResult, error)
ValidateRequest(req PDFGenerationRequest) error
GetSupportedEngines() []string
GetSupportedFormats() []string
}
PDFGenerationService defines the interface for PDF generation
type PDFMetadata ¶
type PDFMetadata struct {
FileSize int64
PageCount int
GeneratedAt time.Time
Engine string
Template string
}
PDFMetadata contains metadata about a PDF file
type PDFValidator ¶
type PDFValidator interface {
Validate(pdfPath string) error
GetMetadata(pdfPath string) (PDFMetadata, error)
IsValidPDF(pdfPath string) bool
}
PDFValidator defines the interface for validating generated PDFs
type TemplateProcessingService ¶
type TemplateProcessingService interface {
Process(ctx context.Context, templatePath string, variables map[string]string) (string, error)
ValidateTemplate(templatePath string) error
GetTemplateVariables(templatePath string) ([]string, error)
}
TemplateProcessingService defines the interface for template processing
type TemplateVariables ¶ added in v1.2.2
type TemplateVariables struct {
// contains filtered or unexported fields
}
TemplateVariables is a Domain Value Object representing variables for template processing It wraps config.Variables and provides domain-specific validation and conversion methods
func NewTemplateVariables ¶ added in v1.2.2
func NewTemplateVariables(vars *config.Variables) *TemplateVariables
NewTemplateVariables creates a new TemplateVariables from config.Variables
func NewTemplateVariablesFromMap ¶ added in v1.2.2
func NewTemplateVariablesFromMap(m map[string]interface{}) (*TemplateVariables, error)
NewTemplateVariablesFromMap creates TemplateVariables from a map[string]interface{} This is used for backward compatibility with existing API endpoints
func NewTemplateVariablesFromStruct ¶ added in v1.2.2
func NewTemplateVariablesFromStruct(s interface{}, conv *converter.StructConverter) (*TemplateVariables, error)
NewTemplateVariablesFromStruct creates TemplateVariables from a struct using StructConverter This enables type-safe variable creation from domain objects
func (*TemplateVariables) Clone ¶ added in v1.2.2
func (tv *TemplateVariables) Clone() *TemplateVariables
Clone creates a deep copy of the TemplateVariables
func (*TemplateVariables) Flatten ¶ added in v1.2.2
func (tv *TemplateVariables) Flatten() map[string]string
Flatten converts TemplateVariables to map[string]string for template processing This is the main method used by the template processor
func (*TemplateVariables) Get ¶ added in v1.2.2
func (tv *TemplateVariables) Get(key string) (config.Variable, bool)
Get retrieves a variable by name
func (*TemplateVariables) GetString ¶ added in v1.2.2
func (tv *TemplateVariables) GetString(key string) (string, bool)
GetString retrieves a variable as a string by name
func (*TemplateVariables) IsEmpty ¶ added in v1.2.2
func (tv *TemplateVariables) IsEmpty() bool
IsEmpty returns true if there are no variables
func (*TemplateVariables) Keys ¶ added in v1.2.2
func (tv *TemplateVariables) Keys() []string
Keys returns all variable names
func (*TemplateVariables) Len ¶ added in v1.2.2
func (tv *TemplateVariables) Len() int
Len returns the number of variables
func (*TemplateVariables) Merge ¶ added in v1.2.2
func (tv *TemplateVariables) Merge(other *TemplateVariables)
Merge merges another TemplateVariables into this one Variables from other will override existing variables with the same name
func (*TemplateVariables) Set ¶ added in v1.2.2
func (tv *TemplateVariables) Set(key string, value config.Variable)
Set sets a variable by name
func (*TemplateVariables) SetString ¶ added in v1.2.2
func (tv *TemplateVariables) SetString(key string, value string) error
SetString sets a string variable by name
func (*TemplateVariables) ToMap ¶ added in v1.2.2
func (tv *TemplateVariables) ToMap() map[string]interface{}
ToMap converts TemplateVariables to map[string]interface{} Used for backward compatibility and serialization
func (*TemplateVariables) Validate ¶ added in v1.2.2
func (tv *TemplateVariables) Validate() error
Validate performs domain-specific validation on the variables
type VariableResolver ¶
type VariableResolver interface {
Resolve(variables *TemplateVariables) (map[string]string, error)
Flatten(variables *TemplateVariables) map[string]string
Validate(variables *TemplateVariables) error
}
VariableResolver defines the interface for resolving complex variables
type WatchInstanceInfo ¶ added in v1.2.2
type WatchInstanceInfo struct {
ID string `json:"id"`
TemplatePath string `json:"template_path"`
RequestID string `json:"request_id"`
StartedAt time.Time `json:"started_at"`
Duration time.Duration `json:"duration"`
}
WatchInstanceInfo provides information about a watch instance
type WatchModeManager ¶ added in v1.2.2
type WatchModeManager interface {
StartWatchMode(ctx context.Context, req PDFGenerationRequest) error
StopWatchMode(watchID string) error
StopAllWatchModes() error
GetActiveWatches() map[string]WatchInstanceInfo
}
WatchModeManager defines the interface for managing watch mode operations
type WatchService ¶ added in v1.2.2
type WatchService interface {
StartWatchMode(ctx context.Context, req PDFGenerationRequest) error
StopWatchMode(watchID string) error
StopAllWatchModes() error
GetActiveWatchModes() map[string]WatchInstanceInfo
ShouldStartWatchMode(req PDFGenerationRequest, result PDFGenerationResult) bool
IsWatchModeAvailable() bool
}
WatchService defines the interface for watch-related operations