report

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

nolint: goconst // Validation messages don't need to be constants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TemplatePath        string        // Absolute path to the input Excel template file (.xlsx).
	DataSourceRefColumn string        // Uppercase Excel column letter indicating the SQL file reference (e.g., "R").
	QueriesDir          string        // Absolute base directory for resolving SQL file paths found in the reference column.
	OutputPath          string        // Absolute path where the generated report will be saved.
	Timeout             time.Duration // Maximum duration allowed for the entire report generation process.
}

func (Config) Valid

func (c Config) Valid(_ context.Context) map[string]string

type Generator

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

func NewGenerator

func NewGenerator(source datasource.DataSource, cfg Config, logger *slog.Logger) *Generator

func (*Generator) GenerateReport

func (g *Generator) GenerateReport(ctx context.Context) error

GenerateReport orchestrates the report generation: 1. Copies the template to the output path. 2. Opens the copied file. 3. Processes each sheet, looking for SQL references in rows. 4. Fetches data and replaces placeholders. 5. Saves the modified file. Respects context for cancellation/timeouts.

Jump to

Keyboard shortcuts

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