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>
1.5 KiB
1.5 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 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| config_dump | function | go | infra | 1.0.0 | pure | func ConfigDump(cfg any) map[string]string | Convierte una struct de configuracion a map[string]string para logging o inspeccion. Campos con tag secret:"true" aparecen como "***". Solo campos exportados de nivel superior. |
|
false |
|
|
mapa string→string con cada campo exportado; valores secretos reemplazados con *** | true |
|
functions/infra/config_dump_test.go | functions/infra/config_dump.go |
Ejemplo
type AppConfig struct {
Host string
Port int
APIKey string `secret:"true"`
}
cfg := AppConfig{Host: "localhost", Port: 8080, APIKey: "sk-abc123"}
dump := ConfigDump(cfg)
// dump = {"Host": "localhost", "Port": "8080", "APIKey": "***"}
log.Printf("startup config: %v", dump)
Notas
Funcion pura. Usa fmt.Sprintf("%v") para formatear todos los tipos. No desciende a structs anidados. Util para logging seguro de configuracion al inicio de una app.