Documentation
¶
Index ¶
- Constants
- type PDFFile
- func (pf *PDFFile) Exists() bool
- func (pf *PDFFile) GetErrors() []error
- func (pf *PDFFile) GetFileSize() (int64, error)
- func (pf *PDFFile) GetMetadata() (*generation.PDFMetadata, error)
- func (pf *PDFFile) GetModificationTime() (time.Time, error)
- func (pf *PDFFile) GetPageCount() (int, error)
- func (pf *PDFFile) HasErrors() bool
- func (pf *PDFFile) IsValid() bool
- func (pf *PDFFile) Path() string
- func (pf *PDFFile) String() string
- func (pf *PDFFile) Validate() error
- type PDFFileRepository
- type PDFFileService
- type PDFGenerationError
- type TemplateProcessingError
- type VariableResolutionError
Constants ¶
const ( ErrCodeTemplateNotFound = "TEMPLATE_NOT_FOUND" ErrCodeTemplateInvalid = "TEMPLATE_INVALID" ErrCodeEngineNotFound = "ENGINE_NOT_FOUND" ErrCodeOutputPathInvalid = "OUTPUT_PATH_INVALID" ErrCodeVariableInvalid = "VARIABLE_INVALID" ErrCodePDFGenerationFailed = "PDF_GENERATION_FAILED" ErrCodePDFValidationFailed = "PDF_VALIDATION_FAILED" ErrCodeTimeoutExceeded = "TIMEOUT_EXCEEDED" )
Constants for error codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PDFFile ¶
type PDFFile struct {
// contains filtered or unexported fields
}
PDFFile represents a PDF file as a domain entity This encapsulates all PDF-related operations and state
func NewPDFFile ¶
NewPDFFile creates a new PDF file entity from a file path
func (*PDFFile) GetFileSize ¶
GetFileSize returns the file size in bytes
func (*PDFFile) GetMetadata ¶
func (pf *PDFFile) GetMetadata() (*generation.PDFMetadata, error)
GetMetadata returns the PDF metadata, loading it if necessary
func (*PDFFile) GetModificationTime ¶
GetModificationTime returns the file modification time
func (*PDFFile) GetPageCount ¶
GetPageCount returns the number of pages in the PDF
type PDFFileRepository ¶
type PDFFileRepository interface {
FindByPath(path string) (*PDFFile, error)
Save(pdf *PDFFile) error
Delete(pdf *PDFFile) error
Exists(path string) bool
}
PDFFileRepository defines the interface for PDF file operations
type PDFFileService ¶
type PDFFileService interface {
CreatePDFFile(path string) (*PDFFile, error)
ValidatePDFFile(pdf *PDFFile) error
GetPDFMetadata(pdf *PDFFile) (*generation.PDFMetadata, error)
ConvertToImages(pdf *PDFFile, formats []string) ([]string, error)
}
PDFFileService defines the interface for PDF file business logic
type PDFGenerationError ¶
type PDFGenerationError struct {
Code string
Message string
Details *api.ErrorDetails
}
Error types for domain-specific errors
func (PDFGenerationError) Error ¶
func (e PDFGenerationError) Error() string
type TemplateProcessingError ¶
type TemplateProcessingError struct {
Code string
Message string
Details *api.ErrorDetails
}
func (TemplateProcessingError) Error ¶
func (e TemplateProcessingError) Error() string
type VariableResolutionError ¶
type VariableResolutionError struct {
Code string
Message string
Details *api.ErrorDetails
}
func (VariableResolutionError) Error ¶
func (e VariableResolutionError) Error() string