services

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 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

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) *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) 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
}

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) 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

Jump to

Keyboard shortcuts

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