services

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 13 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversionOptions

type ConversionOptions struct {
	Enabled bool
	Formats []string
}

ConversionOptions represents conversion options

type PDFGenerationAPIService

type PDFGenerationAPIService struct {
	// contains filtered or unexported fields
}

PDFGenerationAPIService provides a clean API for PDF generation

func NewPDFGenerationAPIService

func NewPDFGenerationAPIService(cfg *config.Config, logger *logger.LoggerAdapter, debugEnabled bool) *PDFGenerationAPIService

NewPDFGenerationAPIService creates a new API service

func NewPDFGenerationAPIServiceWithPortLogger added in v1.3.0

func NewPDFGenerationAPIServiceWithPortLogger(cfg *config.Config, logger *logger.LoggerAdapter, debugEnabled bool, publicLogger api.Logger) *PDFGenerationAPIService

NewPDFGenerationAPIServiceWithPortLogger creates a new API service with optional public Logger for latexmk transparency

func (*PDFGenerationAPIService) GeneratePDF

func (s *PDFGenerationAPIService) GeneratePDF(ctx context.Context, templatePath string, outputPath string, variables map[string]interface{}) ([]byte, map[string]string, error)

GeneratePDF generates a PDF using the builder pattern

func (*PDFGenerationAPIService) GeneratePDFFromStruct added in v1.2.2

func (s *PDFGenerationAPIService) GeneratePDFFromStruct(ctx context.Context, templatePath string, outputPath string, data interface{}) ([]byte, map[string]string, error)

GeneratePDFFromStruct generates a PDF from a struct (converts struct to variables automatically)

func (*PDFGenerationAPIService) GeneratePDFFromStructWithWorkingDir added in v1.3.0

func (s *PDFGenerationAPIService) GeneratePDFFromStructWithWorkingDir(ctx context.Context, templatePath string, outputPath string, data interface{}, workingDir string) ([]byte, map[string]string, error)

GeneratePDFFromStructWithWorkingDir generates a PDF from a struct with custom working directory Uses the full application service pipeline to ensure variable resolution works correctly

func (*PDFGenerationAPIService) GeneratePDFWithOptions

func (s *PDFGenerationAPIService) GeneratePDFWithOptions(ctx context.Context, options PDFGenerationOptions) ([]byte, map[string]string, error)

GeneratePDFWithOptions generates a PDF with custom options

func (*PDFGenerationAPIService) GetSupportedEngines

func (s *PDFGenerationAPIService) GetSupportedEngines() []string

GetSupportedEngines returns supported LaTeX engines

func (*PDFGenerationAPIService) GetSupportedFormats

func (s *PDFGenerationAPIService) GetSupportedFormats() []string

GetSupportedFormats returns supported output formats

func (*PDFGenerationAPIService) GetTemplateVariables

func (s *PDFGenerationAPIService) GetTemplateVariables(templatePath string) ([]string, error)

GetTemplateVariables extracts variables from a template

func (*PDFGenerationAPIService) ValidateTemplate

func (s *PDFGenerationAPIService) ValidateTemplate(templatePath string) error

ValidateTemplate validates a template file

type PDFGenerationOptions

type PDFGenerationOptions struct {
	TemplatePath string
	OutputPath   string
	Engine       string
	Variables    map[string]interface{}
	Conversion   ConversionOptions
	Cleanup      bool
	Timeout      time.Duration
	Verbose      bool
	Debug        bool
	Passes       int  // Number of compilation passes
	UseLatexmk   bool // Whether to use latexmk
}

PDFGenerationOptions represents options for PDF generation

func NewPDFGenerationOptions

func NewPDFGenerationOptions(templatePath, outputPath string) *PDFGenerationOptions

NewPDFGenerationOptions creates new PDF generation options

func (*PDFGenerationOptions) WithCleanup

func (o *PDFGenerationOptions) WithCleanup(enabled bool) *PDFGenerationOptions

WithCleanup enables cleanup

func (*PDFGenerationOptions) WithConversion

func (o *PDFGenerationOptions) WithConversion(enabled bool, formats ...string) *PDFGenerationOptions

WithConversion enables conversion

func (*PDFGenerationOptions) WithDebug

func (o *PDFGenerationOptions) WithDebug(enabled bool) *PDFGenerationOptions

WithDebug enables debug logging

func (*PDFGenerationOptions) WithEngine

func (o *PDFGenerationOptions) WithEngine(engine string) *PDFGenerationOptions

WithEngine sets the LaTeX engine

func (*PDFGenerationOptions) WithLatexmk added in v1.3.0

func (o *PDFGenerationOptions) WithLatexmk(enabled bool) *PDFGenerationOptions

WithLatexmk enables latexmk compilation

func (*PDFGenerationOptions) WithPasses added in v1.3.0

func (o *PDFGenerationOptions) WithPasses(passes int) *PDFGenerationOptions

WithPasses sets the number of compilation passes

func (*PDFGenerationOptions) WithTimeout

func (o *PDFGenerationOptions) WithTimeout(timeout time.Duration) *PDFGenerationOptions

WithTimeout sets timeout

func (*PDFGenerationOptions) WithVariable

func (o *PDFGenerationOptions) WithVariable(key string, value interface{}) *PDFGenerationOptions

WithVariable sets a variable

func (*PDFGenerationOptions) WithVariables

func (o *PDFGenerationOptions) WithVariables(variables map[string]interface{}) *PDFGenerationOptions

WithVariables sets multiple variables

func (*PDFGenerationOptions) WithVerbose

func (o *PDFGenerationOptions) WithVerbose(enabled bool) *PDFGenerationOptions

WithVerbose enables verbose logging

type WatchInstance added in v1.2.2

type WatchInstance struct {
	ID           string
	TemplatePath string
	RequestID    string
	WatchService watch.WatchService
	Config       watch.WatchConfiguration
	StartedAt    time.Time
	Context      context.Context
	Cancel       context.CancelFunc
}

WatchInstance represents an active watch mode instance

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 struct {
	// contains filtered or unexported fields
}

WatchModeManager manages watch mode instances for PDF generation

func NewWatchModeManager added in v1.2.2

func NewWatchModeManager(logger *logger.LoggerAdapter) *WatchModeManager

NewWatchModeManager creates a new watch mode manager

func (*WatchModeManager) GetActiveWatches added in v1.2.2

func (m *WatchModeManager) GetActiveWatches() map[string]WatchInstanceInfo

GetActiveWatches returns information about active watch modes

func (*WatchModeManager) StartWatchMode added in v1.2.2

StartWatchMode starts watching for a PDF generation request

func (*WatchModeManager) StopAllWatchModes added in v1.2.2

func (m *WatchModeManager) StopAllWatchModes() error

StopAllWatchModes stops all active watch modes

func (*WatchModeManager) StopWatchMode added in v1.2.2

func (m *WatchModeManager) StopWatchMode(watchID string) error

StopWatchMode stops watching for a specific watch ID

Jump to

Keyboard shortcuts

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