Files
fn_registry/functions/infra/vault_manifest_read.md
T
egutierrez a802f59f55 chore: auto-commit (95 archivos)
- cmd/fn/doctor.go
- cmd/fn/main.go
- cpp/apps/primitives_gallery/playground/tables/CMakeLists.txt
- cpp/apps/primitives_gallery/playground/tables/data_table.cpp
- cpp/apps/primitives_gallery/playground/tables/data_table_logic.cpp
- cpp/apps/primitives_gallery/playground/tables/data_table_logic.h
- cpp/apps/primitives_gallery/playground/tables/self_test.cpp
- cpp/apps/primitives_gallery/playground/tables/tql.cpp
- cpp/apps/primitives_gallery/playground/tables/viz.cpp
- cpp/apps/primitives_gallery/playground/tables/viz.h
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 00:50:34 +02:00

2.2 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
vault_manifest_read function go infra 1.0.0 impure func VaultManifestRead(repoRoot string) ([]VaultManifestEntry, error) Lee todos los manifests vault.yaml bajo projects/*/vaults/ del repo y devuelve una lista plana de entradas de vault con su ProjectID inferido del path.
vault
manifest
yaml
infra
projects
storage
false error_go_core
fmt
os
path/filepath
strings
gopkg.in/yaml.v3
name desc
repoRoot Ruta absoluta a la raiz del repositorio fn_registry. Se usa como base para el glob projects/*/vaults/vault.yaml.
Slice plano de VaultManifestEntry (ProjectID, Name, Description, Path, Tags, ManifestFile). Vacio si no hay manifests. Error si un yaml no parsea, con el path concreto en el mensaje. true
TestVaultManifestRead_HappyPath
TestVaultManifestRead_MalformedYAML
TestVaultManifestRead_EmptyDir
functions/infra/vault_manifest_read_test.go functions/infra/vault_manifest_read.go

Ejemplo

entries, err := VaultManifestRead("/home/lucas/fn_registry")
if err != nil {
    log.Fatal(err)
}
for _, e := range entries {
    fmt.Printf("%s/%s -> %s\n", e.ProjectID, e.Name, e.Path)
}
// app_turismo/turismo_spain -> /home/lucas/vaults/turismo_spain
// app_finance/finance_data  -> /home/lucas/vaults/finance_data

Notas

VaultManifestEntry es un tipo local de esta funcion (no un tipo del registry). Contiene:

  • ProjectID — basename del directorio projects/<proj>/, inferido del path del manifest.
  • Name, Description, Path, Tags — copiados del yaml tal cual.
  • ManifestFile — path absoluto al vault.yaml de origen, util para mensajes de error y trazabilidad.

El parseo usa gopkg.in/yaml.v3 (ya en go.mod). Si un manifest falla, la funcion devuelve error inmediatamente con el path del fichero problemático. Los manifests sin entradas vaults: contribuyen cero entries (no es error). Si no existe ningun projects/*/vaults/vault.yaml el resultado es slice vacio sin error.