generation

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversionOptions

type ConversionOptions = model.ConversionOptions

ConversionOptions contains settings for PDF to image conversion.

type DebugOptions

type DebugOptions struct {
	Enabled            bool
	LogToFile          bool
	LogFilePath        string
	CreateConcreteFile bool
	RequestID          string
}

DebugOptions contains debug-specific settings

type PDFGenerationOptions

type PDFGenerationOptions struct {
	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
	WorkingDir string // Working directory for LaTeX compilation (isolates template builds)
	Passes     int    // Number of compilation passes
	UseLatexmk bool   // Whether to use latexmk
}

PDFGenerationOptions contains optional settings for PDF generation. Deprecated: configure api.Request directly for new integrations.

type PDFGenerationRequest

type PDFGenerationRequest struct {
	TemplatePath string
	Variables    *TemplateVariables
	Engine       string
	OutputPath   string
	Options      PDFGenerationOptions
}

PDFGenerationRequest represents a request to generate a PDF. Deprecated: use api.Request through api.Engine for new integrations.

type PDFGenerationResult

type PDFGenerationResult struct {
	PDFPath    string
	ImagePaths []string
	Success    bool
	Error      error
	Metadata   PDFMetadata
}

PDFGenerationResult represents the result of PDF generation. Deprecated: use api.Result through api.Engine for new integrations.

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 = model.PDFMetadata

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

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

func NewTemplateVariables(vars *config.Variables) *TemplateVariables

NewTemplateVariables creates a new TemplateVariables from config.Variables

func NewTemplateVariablesFromMap

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

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

func (tv *TemplateVariables) Clone() *TemplateVariables

Clone creates a deep copy of the TemplateVariables

func (*TemplateVariables) Flatten

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

func (tv *TemplateVariables) Get(key string) (config.Variable, bool)

Get retrieves a variable by name

func (*TemplateVariables) GetString

func (tv *TemplateVariables) GetString(key string) (string, bool)

GetString retrieves a variable as a string by name

func (*TemplateVariables) IsEmpty

func (tv *TemplateVariables) IsEmpty() bool

IsEmpty returns true if there are no variables

func (*TemplateVariables) Keys

func (tv *TemplateVariables) Keys() []string

Keys returns all variable names

func (*TemplateVariables) Len

func (tv *TemplateVariables) Len() int

Len returns the number of variables

func (*TemplateVariables) Merge

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

func (tv *TemplateVariables) Set(key string, value config.Variable)

Set sets a variable by name

func (*TemplateVariables) SetString

func (tv *TemplateVariables) SetString(key string, value string) error

SetString sets a string variable by name

func (*TemplateVariables) ToMap

func (tv *TemplateVariables) ToMap() map[string]interface{}

ToMap converts TemplateVariables to map[string]interface{} Used for backward compatibility and serialization

func (*TemplateVariables) Validate

func (tv *TemplateVariables) Validate() error

Validate performs domain-specific validation on the variables

type VariableCloner

type VariableCloner interface {
	CloneVariable() config.Variable
}

VariableCloner copies a custom template variable.

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

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

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

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

Jump to

Keyboard shortcuts

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