Skip to main content

Crate puerto_nucleo

Crate puerto_nucleo 

Source
Expand description

Puerto’s runtime core: the domain types every project generated by Puerto shares, whatever its entities and adapters — paged lists, the repository error, domain events with the ports their transports implement, and the mail ports, and the auth port.

No driver, no runtime, no I/O: a project’s domain layer depends on it (ADR-0017, ADR-0018).

Re-exports§

pub use auth::Autenticador;
pub use auth::ErrorAuth;
pub use auth::Principal;
pub use error_repositorio::ErrorRepositorio;
pub use eventos::ErrorDecodificacion;
pub use eventos::EventoDominio;
pub use eventos::ManejadorEvento;
pub use eventos::ResultadoManejo;
pub use eventos::SobreEvento;
pub use paginacion::LIMITE_PAGINA_MAXIMO;
pub use paginacion::LIMITE_PAGINA_POR_DEFECTO;
pub use paginacion::Pagina;
pub use paginacion::PeticionPagina;

Modules§

auth
Auth (ADR-0021): who is calling and the port that says so. A route sees a Principal, never a token; where the token was checked — an OIDC provider, a local session — is the Autenticador’s business. The adapters are puerto-auth’s and puerto-sqlx’s, the HTTP side (BearerAuth, #[requiere_rol]) puerto-web’s.
correo
Mail (ADR-0020): the message a project sends and the ports that send it. A project’s {Mail}EnviadorCorreo port takes its own typed data; its implementation renders the templates into an Correo and hands it to a EnviadorCorreo. The SMTP adapter is puerto-correo’s, the sent log puerto-sqlx’s.
error_repositorio
eventos
Domain events (ADR-0018): what a write records in the outbox, and the transport-neutral parts every transport shares — the envelope, the handler a consumer implements, the delivery policy and the ports the worker drives.
paginacion