settingsrs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

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:

  1. PUT request to /api/caweb/(v1|v2)/settings in order to update the mutable settings and reload the caweb.
  2. 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:

  1. The settings field for reporting of visible settings which may be mutable or immutable,
  2. 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,
  3. 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.

Jump to

Keyboard shortcuts

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