Documentation
¶
Index ¶
- func EnsureDefaults() error
- func GetAllSettings() (map[string]string, error)
- func GetSetting(key string) (string, error)
- func HandleGetSettings(w http.ResponseWriter, _ *http.Request)
- func HandlePutSettings(w http.ResponseWriter, r *http.Request)
- func HandleTestSmtp(w http.ResponseWriter, r *http.Request)
- func IsOnboarded() bool
- func LoadIntoConfig() error
- func SetSetting(key, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDefaults ¶
func EnsureDefaults() error
EnsureDefaults writes any missing well-known keys with their default values. Existing values are never overwritten.
func GetAllSettings ¶
GetAllSettings returns all settings as a map.
func GetSetting ¶
GetSetting retrieves a single setting value by key from the settings table.
func HandleGetSettings ¶ added in v1.4.4
func HandleGetSettings(w http.ResponseWriter, _ *http.Request)
HandleGetSettings godoc @Summary Get system settings @Description Retrieve all system settings (except sensitive values). @Tags admin @Produce json @Security BearerAuth @Success 200 {object} map[string]string @Router /admin/api/settings [get]
func HandlePutSettings ¶ added in v1.4.4
func HandlePutSettings(w http.ResponseWriter, r *http.Request)
HandlePutSettings godoc @Summary Update system settings @Description Update multiple settings by key-value pairs. @Tags admin @Accept json @Security BearerAuth @Success 204 @Failure 400 {object} model.ApiError @Failure 500 {object} model.ApiError @Router /admin/api/settings [put]
func HandleTestSmtp ¶ added in v1.5.8
func HandleTestSmtp(w http.ResponseWriter, r *http.Request)
HandleTestSmtp godoc @Summary Test SMTP configuration @Description Sends a test email to the currently authenticated admin's registered email address. @Tags admin @Produce json @Security BearerAuth @Success 200 {object} map[string]string @Failure 400 {object} model.ApiError @Failure 500 {object} model.ApiError @Router /admin/api/settings/test-smtp [post]
func IsOnboarded ¶
func IsOnboarded() bool
IsOnboarded returns true if the onboarded setting is "true".
func LoadIntoConfig ¶
func LoadIntoConfig() error
LoadIntoConfig reads all settings from the DB and populates config.Values.
func SetSetting ¶
SetSetting inserts or replaces a setting key-value pair.
Types ¶
This section is empty.