Documentation
¶
Overview ¶
Package settingsapi serves the /api/v1/admin/settings/smtp surface: the stored SMTP configuration (#631), the send-test action, and the test recipient's notification opt-out status (#1022). It is a decomposition seam of pkg/admin (which sits at the package size budget): the parent registers it on the admin mux and injects the request-scoped helpers it shares with the other admin routes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Settings persists the admin SMTP configuration. nil disables every
// route in this package.
Settings notification.SettingsStore
// SendTest delivers a test email through the stored SMTP settings. nil
// disables the test route.
SendTest func(ctx context.Context, to string) error
// Prefs reads per-address notification preferences so the test-send UI
// can surface a target's opt-out state (#1022). nil disables the
// recipient-status route.
Prefs notification.PrefsStore
// Mutable reports database config mode; false swaps the write routes for
// ReadOnly.
Mutable bool
// Author resolves the acting admin for audit columns.
Author func(*http.Request) string
// Decode is the parent's strict JSON body decoder (unknown fields
// rejected, size-capped); its error text is safe to return as the
// problem detail.
Decode func(w http.ResponseWriter, r *http.Request, dst any) error
// ReadOnly is the parent's 405 not-available-in-file-mode responder.
ReadOnly http.HandlerFunc
}
Config carries the stores and parent-owned helpers the routes need.
Click to show internal directories.
Click to hide internal directories.