988e901066
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
45 lines
1.3 KiB
Markdown
45 lines
1.3 KiB
Markdown
---
|
|
name: wails_bind_crud
|
|
kind: function
|
|
lang: go
|
|
domain: infra
|
|
version: "1.0.0"
|
|
purity: pure
|
|
signature: "GenerateWailsCRUD(spec WailsCRUDSpec) string"
|
|
description: "Genera código Go de bindings CRUD para Wails: struct + métodos List/Get/Create/Update/Delete con stubs not-implemented."
|
|
tags: [wails, crud, generator, bindings, codegen, infra]
|
|
uses_functions: []
|
|
uses_types: []
|
|
returns: []
|
|
returns_optional: false
|
|
error_type: ""
|
|
imports: [fmt, strings]
|
|
params:
|
|
- name: spec
|
|
desc: "estructura WailsCRUDSpec con EntityName, Fields, WithList/Get/Create/Update/Delete flags"
|
|
output: "string con codigo Go generado (struct + metodos CRUD stubs)"
|
|
tested: false
|
|
tests: []
|
|
test_file_path: ""
|
|
file_path: "functions/infra/wails_bind_crud.go"
|
|
---
|
|
|
|
## Ejemplo
|
|
|
|
```go
|
|
code := GenerateWailsCRUD(WailsCRUDSpec{
|
|
EntityName: "User",
|
|
Fields: []string{"Name string", "Email string", "Role string"},
|
|
WithList: true,
|
|
WithGet: true,
|
|
WithCreate: true,
|
|
WithUpdate: true,
|
|
WithDelete: true,
|
|
})
|
|
// Genera: type User struct + ListUsers + GetUser + CreateUser + UpdateUser + DeleteUser
|
|
```
|
|
|
|
## Notas
|
|
|
|
Función pura — genera código como string. Los métodos son stubs con `return fmt.Errorf("not implemented")`. Un agente puede generar el código, insertarlo en app.go, y luego implementar los TODOs.
|