Documentation
¶
Overview ¶
Package templates compiles and renders web page and email templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectorData ¶
ConnectorData describes a sign-in option rendered by the selector.
type ConsentData ¶
type ConsentData struct{ Title, State, ClientID string }
ConsentData supplies data to the offline-access consent template.
type ErrorData ¶
type ErrorData struct{ Title, Message string }
ErrorData supplies data to the error page template.
type GrantData ¶
type GrantData struct {
SID, ClientID, Mode, ActionToken, Email string
CreatedAt, LastUsedAt, ExpiresAt time.Time
}
GrantData describes one active grant and its one-use revocation action.
type GrantsData ¶
GrantsData supplies the self-service grant management page.
type IdentityData ¶
IdentityData supplies data to the identity selection template.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns the compiled page and email templates.
func Load ¶
Load compiles each page with the effective common layout and test-renders all templates.
func (*Manager) HandlePublic ¶ added in v2.1.0
func (m *Manager) HandlePublic(w http.ResponseWriter, r *http.Request)
HandlePublic serves an exact file loaded from the public template subtree.
func (*Manager) RenderEmail ¶
RenderEmail renders an OTP email in the requested format.
func (*Manager) RenderEmailSubject ¶
func (m *Manager) RenderEmailSubject(data OTPEmailData) (string, error)
RenderEmailSubject renders and validates an OTP email subject.
type OTPData ¶
type OTPData struct {
Title, ChallengeID, Message, Error, Email string
ExpiresIn, RetryAfter time.Duration
ExpiresAt time.Time
RetryAfterSeconds int64
}
OTPData supplies data to the OTP entry template.
type OTPEmailData ¶
OTPEmailData supplies data to OTP email templates.
type SelectorData ¶
type SelectorData struct {
Title string
State string
SiteKey string
Connectors []ConnectorData
}
SelectorData supplies data to the sign-in selector template.