Triplex v1.3.0 Triplex.Plug View Source
This module have some basic functions for our triplex plugs.
The plugs we have for now are:
Triplex.ParamPlug
- loads the tenant from a body or query paramTriplex.SessionPlug
- loads the tenant from a session paramTriplex.SubdomainPlug
- loads the tenant from the url subdomainTriplex.EnsurePlug
- ensures the current tenant is loaded and halts if not
Link to this section Summary
Functions
Ensure the tenant is loaded, and if not, halts the conn
Puts the given tenant
as an assign on the given conn
, but only if the
tenant is not reserved
Link to this section Functions
Ensure the tenant is loaded, and if not, halts the conn
.
The config
map/struct must have:
assign
: the name of the assign where we must save the tenant.
Puts the given tenant
as an assign on the given conn
, but only if the
tenant is not reserved.
The config
map/struct must have:
tenant_handler
: function to handle the tenant param. Its return will be used as the tenant.assign
: the name of the assign where we must save the tenant.