Documentation
¶
Index ¶
Constants ¶
View Source
const ( MailModeSMTP = "smtp" MailModeDev = "dev" // MailModeResend labels the Resend HTTP email channel // (notify/adapters/email/resend) — the /config mail_mode value and the // admin status badge share it (shuijing already used the string). MailModeResend = "resend" )
Variables ¶
This section is empty.
Functions ¶
func MountAdmin ¶
Types ¶
type AdminDeps ¶
type AdminDeps struct {
Store *settings.Store
Guard func(http.Handler) http.Handler
Mailer Mailer
// MailModeFn reports the active mail channel (MailModeDev / MailModeSMTP)
// and is read per request so hot-swapped mailers stay truthful. Breaking
// change vs the old static MailMode string. nil = not tracked: the list
// response carries an empty "mail_mode" and testEmail takes the smtp
// branch (same as the old empty-string default).
MailModeFn func() string
// OAuthInfo optionally reports the configured OAuth providers together
// with their EXPECTED callback URLs (derived from the configured base
// URL, for comparison against what is registered in the provider
// console). The actual runtime callback is computed per-request from
// Host + X-Forwarded-Proto, so reverse proxies must forward both. A nil
// func omits the "oauth" field from the list response entirely
// (silently degrade when unwired).
OAuthInfo func() []OAuthProviderInfo
Log *slog.Logger
}
type OAuthProviderInfo ¶ added in v0.8.0
type OAuthProviderInfo struct {
Name string `json:"name"`
CallbackURL string `json:"callback_url"`
}
OAuthProviderInfo describes one OAuth provider for the admin status card.
Click to show internal directories.
Click to hide internal directories.