47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.8 KiB
2.8 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pdf_simple_report | function | go | infra | 1.0.0 | impure | func PdfSimpleReport(title string, sections []ReportSection, outputPath string) (string, error) | Genera un PDF simple con titulo, secciones de texto y tablas opcionales. Stub activo: requiere go-pdf/fpdf que no esta en el modulo. Para PDFs desde Go añadir la dependencia; para casos complejos usar el builder Python. |
|
false | error_go_core |
|
|
outputPath con el PDF generado, o string vacio + error si la dependencia no esta disponible | false | functions/infra/pdf_simple_report.go |
Tipos auxiliares
type ReportSection struct {
Title string
Text string
Table *ReportTable // nil = sin tabla en esta seccion
}
type ReportTable struct {
Headers []string
Rows [][]string
}
Ejemplo de uso
sections := []infra.ReportSection{
{
Title: "Estado del Registry",
Text: "El registry contiene 142 funciones, 38 tipos y 12 proposals pendientes.",
},
{
Title: "Funciones por Dominio",
Table: &infra.ReportTable{
Headers: []string{"Dominio", "Funciones", "Tipos"},
Rows: [][]string{
{"core", "45", "12"},
{"infra", "38", "8"},
{"finance", "22", "6"},
},
},
},
}
path, err := infra.PdfSimpleReport("Registry Status Report", sections, "registry_report.pdf")
if err != nil {
log.Fatal(err)
}
fmt.Println("PDF generado:", path)
Activar la implementacion real
# Añadir dependencia al modulo Go
go get github.com/go-pdf/fpdf
# La funcion usa la API de go-pdf/fpdf:
# pdf := fpdf.New("P", "mm", "A4", "")
# pdf.AddPage()
# pdf.SetFont("Arial", "B", 16)
# pdf.Cell(0, 10, title)
# ... para cada seccion y tabla
# pdf.OutputFileAndClose(outputPath)
Notas
Stub activo: retorna fmt.Errorf("not implemented: ...") hasta que go-pdf/fpdf se añada al modulo. No añadida como dependencia directa porque solo la usa esta funcion y añade peso al modulo. Para generacion de PDFs desde el registry, la solucion recomendada es el builder Python (pdf_create_py_infra + pdf_add_text_py_infra + pdf_add_table_py_infra + pdf_save_py_infra) que es mas completo y no requiere dependencias adicionales en Go.