Documentation
¶
Overview ¶
Package settings helps plugins describe and validate their settings with JSON Schema (draft 2020-12), the format Panelarr hosts use to render settings and configuration forms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is a compiled settings schema.
func FromStruct ¶
FromStruct compiles a JSON Schema document given as a protobuf Struct, as returned by GetSettingsSchema.
func Parse ¶
Parse compiles a JSON Schema document given as JSON text.
The order properties are written in is lost on the way to a host (a protobuf Struct and JSON maps sort keys), so Parse stamps it on every property, at every depth, as "x-order": 1, 2, 3, … in the order written. Forms show fields in that order. A property that already has "x-order" or "propertyOrder" keeps it.
func (*Schema) WithDefaults ¶
WithDefaults returns values with the schema's top-level property defaults filled in where a value is missing.