domain

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
	ErrCodeWatchServiceUnavailable = "WATCH_SERVICE_UNAVAILABLE"
)

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

func NewPDFFile(path string) *PDFFile

NewPDFFile creates a new PDF file entity from a file path

func (*PDFFile) Exists

func (pf *PDFFile) Exists() bool

Exists checks if the PDF file exists on the filesystem

func (*PDFFile) GetErrors

func (pf *PDFFile) GetErrors() []error

GetErrors returns all validation errors

func (*PDFFile) GetFileSize

func (pf *PDFFile) GetFileSize() (int64, error)

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

func (pf *PDFFile) GetModificationTime() (time.Time, error)

GetModificationTime returns the file modification time

func (*PDFFile) GetPageCount

func (pf *PDFFile) GetPageCount() (int, error)

GetPageCount returns the number of pages in the PDF

func (*PDFFile) HasErrors

func (pf *PDFFile) HasErrors() bool

HasErrors checks if there are any validation errors

func (*PDFFile) IsValid

func (pf *PDFFile) IsValid() bool

IsValid checks if the PDF file is valid

func (*PDFFile) Path

func (pf *PDFFile) Path() string

Path returns the file path of the PDF

func (*PDFFile) String

func (pf *PDFFile) String() string

String returns a string representation of the PDF file

func (*PDFFile) Validate

func (pf *PDFFile) Validate() error

Validate performs comprehensive validation of the PDF file

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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