merge: issue/0018-config-env — Config & env management
# Conflicts: # registry.db
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: config_error
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
algebraic: product
|
||||
definition: |
|
||||
type ConfigError struct {
|
||||
Field string
|
||||
Message string
|
||||
Tag string
|
||||
}
|
||||
description: "Error de validacion de un campo de configuracion. Field identifica el campo, Message describe el problema, Tag indica la regla que fallo (required, format, etc.)."
|
||||
tags: [config, validation, error, infra]
|
||||
uses_types: []
|
||||
file_path: "functions/infra/config_error.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
Tipo producto — todos los campos siempre presentes. Se acumula en ConfigValidation.Errors. Tag toma valores como "required" o "format" para que el consumidor pueda filtrar por tipo de error.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: config_validation
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
algebraic: product
|
||||
definition: |
|
||||
type ConfigValidation struct {
|
||||
Errors []ConfigError
|
||||
IsValid bool
|
||||
}
|
||||
description: "Resultado de validar una struct de configuracion. Contiene todos los errores acumulados y un bool de conveniencia. IsValid es true solo cuando Errors esta vacio."
|
||||
tags: [config, validation, result, infra]
|
||||
uses_types: [config_error_go_infra]
|
||||
file_path: "functions/infra/config_validation.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
Tipo producto. IsValid se computa derivadamente de len(Errors)==0. Permite al consumidor tanto iterar sobre todos los errores como hacer un check rapido con IsValid.
|
||||
Reference in New Issue
Block a user