Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalSchemaJSON(spec *manifest.SettingsSpec) ([]byte, error)
- func DecodeValues(values map[string]json.RawMessage) (map[string]any, error)
- func DefaultValues(fields []Field) (map[string]json.RawMessage, error)
- func NormalizeRawValues(fields []Field, values map[string]json.RawMessage) (map[string]json.RawMessage, error)
- type Field
- type Schema
- type Validation
Constants ¶
View Source
const ( FieldString = "string" FieldBoolean = "boolean" FieldNumber = "number" FieldInteger = "integer" FieldEnum = "enum" FieldSelect = "select" FieldSecret = "secret" )
Variables ¶
View Source
var ErrInvalidSetting = errors.New("plugin setting is invalid")
Functions ¶
func CanonicalSchemaJSON ¶ added in v0.5.0
func CanonicalSchemaJSON(spec *manifest.SettingsSpec) ([]byte, error)
func DecodeValues ¶ added in v0.5.0
func DefaultValues ¶ added in v0.5.0
func DefaultValues(fields []Field) (map[string]json.RawMessage, error)
func NormalizeRawValues ¶ added in v0.5.0
func NormalizeRawValues(fields []Field, values map[string]json.RawMessage) (map[string]json.RawMessage, error)
Types ¶
type Field ¶ added in v0.5.0
type Field struct {
Key string `json:"key"`
Type string `json:"type"`
Scope string `json:"scope"`
Options []string `json:"options,omitempty"`
Default json.RawMessage `json:"default,omitempty"`
Validation *Validation `json:"validation,omitempty"`
}
func NonSecretFields ¶ added in v0.5.0
func NonSecretFields(spec *manifest.SettingsSpec) ([]Field, error)
type Schema ¶ added in v0.5.0
type Schema struct {
SchemaVersion int `json:"schema_version"`
Fields []Field `json:"fields,omitempty"`
}
func CanonicalSchema ¶ added in v0.5.0
func CanonicalSchema(spec *manifest.SettingsSpec) (Schema, error)
func CanonicalizeSchema ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.