appsettings

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func GetAllSettings() (map[string]string, error)

GetAllSettings returns all settings as a map.

func GetSetting

func GetSetting(key string) (string, error)

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 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

func SetSetting(key, value string) error

SetSetting inserts or replaces a setting key-value pair.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL