Documentation ¶
Overview ¶
Package settingsrs realizes the settings resource, allowing the settings fetching and replacement (mutation) REST APIs to be accepted and delegated to the application use case properly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(r1, r2 *gin.RouterGroup, app *appuc.UseCase)
Register instantiates a resource adapting the app use case instance with the relevant REST APIs including:
- PUT request to /api/caweb/(v1|v2)/settings in order to update the mutable settings and reload the caweb.
- GET request to /api/caweb/(v1|v2)/settings in order to fetch the current visible settings.
The v1 endpoints only deal with mutable settings themselves. The v2 endpoints also support the boundary values reporting.
Types ¶
type SettingsResp ¶ added in v1.3.0
type SettingsResp struct { Settings *model.VisibleSettings `json:"settings"` MinBounds *model.Settings `json:"min_bounds"` MaxBounds *model.Settings `json:"max_bounds"` }
SettingsResp publishes three fields in order to be serialized as JSON fields and reported to the frontend as follows:
- The settings field for reporting of visible settings which may be mutable or immutable,
- The min_bounds field for reporting the minimum acceptable value for settings, all settings including the invisible items but excluding those settings which do not have a known lower bound,
- The max_bounds field for reporting the maximum acceptable value for settings, all settings including the invisible items but excluding those settings which do not have a known upper bound.
Click to show internal directories.
Click to hide internal directories.