Documentation
¶
Index ¶
- type Cleaner
- type Command
- type CommandExecutor
- type CommandResult
- type CompileOptions
- func (opts CompileOptions) WithCleanup(cleanup bool) CompileOptions
- func (opts CompileOptions) WithDebug(debug bool) CompileOptions
- func (opts CompileOptions) WithJobName(jobName string) CompileOptions
- func (opts CompileOptions) WithLatexmk(useLatexmk bool) CompileOptions
- func (opts CompileOptions) WithPasses(passes int) CompileOptions
- type Converter
- type FileInfo
- type FileSystem
- type FontValidator
- type LaTeXCompiler
- type LogField
- type Logger
- type PathOperations
- type RebuildResult
- type RebuildService
- type TemplateProcessor
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶ added in v1.3.0
type Command struct {
Executable string
Args []string
Dir string
Env []string
Timeout time.Duration
}
Command is a Value Object representing a command to execute
func NewCommand ¶ added in v1.3.0
NewCommand creates a validated command
type CommandExecutor ¶ added in v1.3.0
type CommandExecutor interface {
// Execute runs a command and returns output
Execute(ctx context.Context, cmd Command) (CommandResult, error)
}
CommandExecutor abstracts command execution (DIP for AutoPDF) This ensures the application layer doesn't depend on os/exec package
type CommandResult ¶ added in v1.3.0
type CommandResult struct {
Stdout string
Stderr string
ExitCode int
Duration time.Duration
Success bool
}
CommandResult represents the result of a command execution
func NewCommandResult ¶ added in v1.3.0
func NewCommandResult(stdout, stderr string, exitCode int, duration time.Duration) CommandResult
NewCommandResult creates a command result
type CompileOptions ¶ added in v1.3.0
type CompileOptions struct {
Engine string // pdflatex, xelatex, lualatex
OutputPath string
WorkingDir string
Passes int // Number of compilation passes
UseLatexmk bool // Whether to use latexmk
JobName string
Cleanup bool // Whether to cleanup aux files
Debug bool // Whether debug mode is enabled
}
CompileOptions represents LaTeX compilation parameters Value Object following DDD principles - immutable and validated
func NewCompileOptions ¶ added in v1.3.0
func NewCompileOptions(engine, outputPath, workingDir string) CompileOptions
NewCompileOptions creates a validated CompileOptions with defaults
func (CompileOptions) WithCleanup ¶ added in v1.3.0
func (opts CompileOptions) WithCleanup(cleanup bool) CompileOptions
WithCleanup sets cleanup behavior
func (CompileOptions) WithDebug ¶ added in v1.3.0
func (opts CompileOptions) WithDebug(debug bool) CompileOptions
WithDebug sets debug mode
func (CompileOptions) WithJobName ¶ added in v1.3.0
func (opts CompileOptions) WithJobName(jobName string) CompileOptions
WithJobName sets the job name
func (CompileOptions) WithLatexmk ¶ added in v1.3.0
func (opts CompileOptions) WithLatexmk(useLatexmk bool) CompileOptions
WithLatexmk enables latexmk usage
func (CompileOptions) WithPasses ¶ added in v1.3.0
func (opts CompileOptions) WithPasses(passes int) CompileOptions
WithPasses sets the number of compilation passes
type Converter ¶
type Converter interface {
ConvertToImages(ctx context.Context, pdfPath string, formats []string) ([]string, error)
}
Converter converts PDFs to images Pure transport types - no domain dependencies
type FileInfo ¶ added in v1.3.0
type FileInfo interface {
Name() string
Size() int64
Mode() fs.FileMode
ModTime() time.Time
IsDir() bool
Sys() interface{}
}
FileInfo abstracts file information
type FileSystem ¶ added in v1.3.0
type FileSystem interface {
// File operations
WriteFile(ctx context.Context, path string, data []byte, perm fs.FileMode) error
ReadFile(ctx context.Context, path string) ([]byte, error)
Remove(ctx context.Context, path string) error
Stat(ctx context.Context, path string) (FileInfo, error)
IsNotExist(err error) bool
// Directory operations
MkdirAll(ctx context.Context, path string, perm fs.FileMode) error
// Symlink operations
Symlink(ctx context.Context, oldname, newname string) error
// Synchronization
Sync(ctx context.Context) error
}
FileSystem abstracts file system operations (DIP for AutoPDF) This ensures the application layer doesn't depend on os package
type FontValidator ¶ added in v1.3.0
type FontValidator interface {
ValidateFonts(ctx context.Context, fontNames []string) (ValidationResult, error)
}
FontValidator checks if required fonts are available
type LaTeXCompiler ¶
type LaTeXCompiler interface {
Compile(ctx context.Context, content string, opts CompileOptions) (string, error)
}
LaTeXCompiler compiles LaTeX content to PDF Pure transport types - no domain dependencies
type LogField ¶ added in v1.3.0
type LogField struct {
Key string
Value interface{}
}
LogField represents a single logging field (key-value pair)
func NewLogField ¶ added in v1.3.0
NewLogField creates a new log field
type Logger ¶ added in v1.3.0
type Logger interface {
// Debug logs a debug-level message
Debug(ctx context.Context, msg string, fields ...LogField)
// Info logs an info-level message
Info(ctx context.Context, msg string, fields ...LogField)
// Warn logs a warning-level message
Warn(ctx context.Context, msg string, fields ...LogField)
// Error logs an error-level message
Error(ctx context.Context, msg string, fields ...LogField)
}
Logger provides structured logging capabilities (DIP for logging) This ensures adapters can log without depending on concrete logging libraries
type PathOperations ¶ added in v1.3.0
type PathOperations interface {
// Path manipulation
Dir(path string) string
Base(path string) string
Ext(path string) string
Join(elem ...string) string
IsAbs(path string) bool
Clean(path string) string
}
PathOperations abstracts path manipulation operations (DIP for AutoPDF) This ensures the application layer doesn't depend on path/filepath package
type RebuildResult ¶ added in v1.3.0
RebuildResult represents the result of a rebuild operation
type RebuildService ¶ added in v1.3.0
type RebuildService interface {
Rebuild(ctx context.Context, templatePath, configPath string) (RebuildResult, error)
}
RebuildService orchestrates document rebuilding from file changes This port abstracts rebuild orchestration following DIP principle Pure transport types - no domain dependencies
type TemplateProcessor ¶
type TemplateProcessor interface {
Process(ctx context.Context, templatePath string, variables map[string]string) (string, error)
}
TemplateProcessor processes templates with variables Pure transport types - no domain dependencies
type ValidationResult ¶ added in v1.3.0
ValidationResult represents font validation results