manifest

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidManifest       error = errors.New("invalid manifest")
	ErrFailedToParseManifest error = errors.New("failed to parse plugin manifest")
	ErrSystemManifest              = errors.New("cannot build system manifest")
)
View Source
var (
	ErrInvalidManifestTranslation       error = errors.New("invalid manifest translation")
	ErrFailedToParseManifestTranslation error = errors.New("failed to parse plugin manifest translation")
)

Functions

This section is empty.

Types

type Choice

type Choice struct {
	Icon  string `json:"icon,omitempty"`
	Key   string `json:"key"`
	Label string `json:"label,omitempty"`
}

type Diff added in v0.5.0

type Diff struct {
	From                  plugin.ID
	To                    plugin.ID
	PropertySchemaDiff    property.SchemaDiff
	PropertySchemaDeleted bool
	DeletedExtensions     []DiffExtensionDeleted
	UpdatedExtensions     []DiffExtensionUpdated
}

func DiffFrom added in v0.5.0

func DiffFrom(old, new Manifest) (d Diff)

func (Diff) DeletedPropertySchemas added in v0.5.0

func (d Diff) DeletedPropertySchemas() []id.PropertySchemaID

func (*Diff) IsEmpty added in v0.5.0

func (d *Diff) IsEmpty() bool

func (Diff) PropertySchmaDiffs added in v0.5.0

func (d Diff) PropertySchmaDiffs() property.SchemaDiffList

type DiffExtensionDeleted added in v0.5.0

type DiffExtensionDeleted struct {
	ExtensionID      plugin.ExtensionID
	PropertySchemaID property.SchemaID
}

type DiffExtensionUpdated added in v0.5.0

type DiffExtensionUpdated struct {
	ExtensionID        plugin.ExtensionID
	OldType            plugin.ExtensionType
	NewType            plugin.ExtensionType
	PropertySchemaDiff property.SchemaDiff
}

type Extendable

type Extendable struct {
	Horizontally *bool `json:"horizontally,omitempty"`
	Vertically   *bool `json:"vertically,omitempty"`
}

type Extension

type Extension struct {
	Description  *string         `json:"description,omitempty"`
	ID           ID              `json:"id"`
	Icon         *string         `json:"icon,omitempty"`
	Name         string          `json:"name"`
	Schema       *PropertySchema `json:"schema,omitempty"`
	SingleOnly   *bool           `json:"singleOnly,omitempty"`
	Type         string          `json:"type"`
	Visualizer   *string         `json:"visualizer,omitempty"`
	WidgetLayout *WidgetLayout   `json:"widgetLayout,omitempty"`
}

type ID

type ID string

type Id

type Id string

type Location

type Location struct {
	Area    string `json:"area,omitempty"`
	Section string `json:"section,omitempty"`
	Zone    string `json:"zone,omitempty"`
}

type Manifest

type Manifest struct {
	Plugin          *plugin.Plugin
	ExtensionSchema property.SchemaList
	Schema          *property.Schema
}

func MustParseSystemFromBytes

func MustParseSystemFromBytes(source []byte, scene *plugin.SceneID, tl *TranslatedRoot) *Manifest

func Parse

func Parse(source io.Reader, scene *plugin.SceneID, tl *TranslatedRoot) (*Manifest, error)

func ParseSystemFromBytes

func ParseSystemFromBytes(source []byte, scene *plugin.SceneID, tl *TranslatedRoot) (*Manifest, error)

func (Manifest) PropertySchema added in v0.4.0

func (m Manifest) PropertySchema(psid property.SchemaID) *property.Schema

func (Manifest) PropertySchemas

func (m Manifest) PropertySchemas() property.SchemaList

type PropertyCondition

type PropertyCondition struct {
	Field string      `json:"field"`
	Type  Valuetype   `json:"type"`
	Value interface{} `json:"value"`
}

type PropertyLinkableFields

type PropertyLinkableFields struct {
	Latlng *PropertyPointer `json:"latlng,omitempty"`
	URL    *PropertyPointer `json:"url,omitempty"`
}

type PropertyPointer

type PropertyPointer struct {
	FieldID       string `json:"fieldId"`
	SchemaGroupID string `json:"schemaGroupId"`
}

type PropertySchema

type PropertySchema struct {
	Groups   []PropertySchemaGroup   `json:"groups,omitempty"`
	Linkable *PropertyLinkableFields `json:"linkable,omitempty"`
	Version  float64                 `json:"version,omitempty"`
}

type PropertySchemaField

type PropertySchemaField struct {
	AvailableIf  *PropertyCondition `json:"availableIf,omitempty"`
	Choices      []Choice           `json:"choices,omitempty"`
	DefaultValue interface{}        `json:"defaultValue,omitempty"`
	Description  *string            `json:"description,omitempty"`
	ID           ID                 `json:"id"`
	Max          *float64           `json:"max,omitempty"`
	Min          *float64           `json:"min,omitempty"`
	Prefix       *string            `json:"prefix,omitempty"`
	Suffix       *string            `json:"suffix,omitempty"`
	Title        *string            `json:"title"`
	Type         Valuetype          `json:"type"`
	UI           *string            `json:"ui,omitempty"`
}

type PropertySchemaGroup

type PropertySchemaGroup struct {
	AvailableIf         *PropertyCondition    `json:"availableIf,omitempty"`
	Description         *string               `json:"description,omitempty"`
	Fields              []PropertySchemaField `json:"fields,omitempty"`
	ID                  ID                    `json:"id"`
	List                bool                  `json:"list,omitempty"`
	RepresentativeField *Id                   `json:"representativeField,omitempty"`
	Title               string                `json:"title"`
}

type Root

type Root struct {
	Author      *string         `json:"author,omitempty"`
	Description *string         `json:"description,omitempty"`
	Extensions  []Extension     `json:"extensions,omitempty"`
	ID          ID              `json:"id"`
	Main        *string         `json:"main,omitempty"`
	Name        string          `json:"name"`
	Repository  *string         `json:"repository,omitempty"`
	Schema      *PropertySchema `json:"schema,omitempty"`
	System      bool            `json:"system,omitempty"`
	Version     string          `json:"version,omitempty"`
}

type TranslatedExtension added in v0.5.0

type TranslatedExtension struct {
	Description    i18n.String
	Name           i18n.String
	PropertySchema TranslatedPropertySchema
}

type TranslatedPropertySchema added in v0.5.0

type TranslatedPropertySchema map[string]*TranslatedPropertySchemaGroup

type TranslatedPropertySchemaField added in v0.5.0

type TranslatedPropertySchemaField struct {
	Choices     map[string]i18n.String
	Description i18n.String
	Title       i18n.String
	Prefix      i18n.String
	Suffix      i18n.String
}

type TranslatedPropertySchemaGroup added in v0.5.0

type TranslatedPropertySchemaGroup struct {
	Description i18n.String
	Fields      map[string]*TranslatedPropertySchemaField
	Title       i18n.String
}

type TranslatedRoot added in v0.5.0

type TranslatedRoot struct {
	Description i18n.String
	Extensions  map[string]*TranslatedExtension
	Name        i18n.String
	Schema      TranslatedPropertySchema
}

type TranslationExtension

type TranslationExtension struct {
	Description    *string                   `json:"description,omitempty"`
	Name           *string                   `json:"name,omitempty"`
	PropertySchema TranslationPropertySchema `json:"propertySchema,omitempty"`
}

type TranslationMap added in v0.5.0

type TranslationMap map[string]TranslationRoot

func (TranslationMap) Translated added in v0.5.0

func (tm TranslationMap) Translated() (res TranslatedRoot)

func (TranslationMap) TranslatedRef added in v0.5.0

func (tm TranslationMap) TranslatedRef() *TranslatedRoot

type TranslationPropertySchema

type TranslationPropertySchema map[string]TranslationPropertySchemaGroup

type TranslationPropertySchemaField

type TranslationPropertySchemaField struct {
	Choices     map[string]string `json:"choices,omitempty"`
	Title       *string           `json:"title,omitempty"`
	Description *string           `json:"description,omitempty"`
	Prefix      *string           `json:"prefix,omitempty"`
	Suffix      *string           `json:"suffix,omitempty"`
}

type TranslationPropertySchemaGroup

type TranslationPropertySchemaGroup struct {
	Description *string                                   `json:"description,omitempty"`
	Fields      map[string]TranslationPropertySchemaField `json:"fields,omitempty"`
	Title       *string                                   `json:"title,omitempty"`
}

type TranslationRoot

type TranslationRoot struct {
	Description *string                         `json:"description,omitempty"`
	Extensions  map[string]TranslationExtension `json:"extensions,omitempty"`
	Name        *string                         `json:"name,omitempty"`
	Schema      TranslationPropertySchema       `json:"schema,omitempty"`
}

func MustParseTranslationFromBytes

func MustParseTranslationFromBytes(source []byte) TranslationRoot

func ParseTranslation

func ParseTranslation(source io.Reader) (TranslationRoot, error)

func ParseTranslationFromBytes

func ParseTranslationFromBytes(source []byte) (TranslationRoot, error)

type Valuetype

type Valuetype string

type WidgetLayout

type WidgetLayout struct {
	DefaultLocation *Location   `json:"defaultLocation,omitempty"`
	Extendable      *Extendable `json:"extendable,omitempty"`
	Extended        *bool       `json:"extended,omitempty"`
	Floating        bool        `json:"floating,omitempty"`
}

Jump to

Keyboard shortcuts

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