services

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 13 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

View Source
var ErrWatchModeUnavailable = errors.New("watch mode is unavailable: no watch service configured")

ErrWatchModeUnavailable is returned until a real filesystem watcher is configured.

Functions

This section is empty.

Types

type ConversionOptions

type ConversionOptions = api.ConversionOptions

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, publicLogger api.Logger, debugEnabled bool) *PDFGenerationAPIService

NewPDFGenerationAPIService creates a new API service

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

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

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 the compatibility service. Deprecated: use api.Request and api.Engine for new integrations.

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

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

WithLatexmk enables latexmk compilation

func (*PDFGenerationOptions) WithPasses

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

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

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

WatchModeManager manages watch mode instances for PDF generation

func NewWatchModeManager

func NewWatchModeManager(logger ports.Logger) *WatchModeManager

NewWatchModeManager creates a new watch mode manager

func (*WatchModeManager) GetActiveWatches

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

GetActiveWatches returns information about active watch modes

func (*WatchModeManager) StartWatchMode

StartWatchMode starts watching for a PDF generation request

func (*WatchModeManager) StopAllWatchModes

func (m *WatchModeManager) StopAllWatchModes() error

StopAllWatchModes stops all active watch modes

func (*WatchModeManager) StopWatchMode

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