parser

package
v0.0.0-...-a5cc226 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildDeviceModel

type ChildDeviceModel struct {
	Name string `json:"name" yaml:"name"`
}

type Connector

type Connector struct {
	Type       string     `json:"type"`
	TargetNode NodeSource `json:"targetNode"`
	SourceNode NodeSource `json:"sourceNode"`
	IsSelect   bool       `json:"isSelect"`
}

type DataField

type DataField struct {
	Key          string `json:"key" yaml:"key"`
	Type         string `json:"type" yaml:"type"`
	DefaultValue string `json:"defaultValue" yaml:"defaultValue"`
}

type DataModel

type DataModel struct {
	Name   string       `json:"name" yaml:"name"`
	Fields []*DataField `json:"fields" yaml:"fields"`
}

type Endpoint

type Endpoint struct {
	Path       string `json:"path" yaml:"path"`
	DataModel  string `json:"dataModel" yaml:"dataModel"`
	Permission string `json:"permission" yaml:"permission"`
}

type ModelDefinition

type ModelDefinition struct {
	Name              string             `json:"name" yaml:"name"`
	Kind              string             `json:"kind" yaml:"kind"`
	Description       string             `json:"description" yaml:"description"`
	Domain            string             `json:"domain" yaml:"domain"`
	Version           string             `json:"version" yaml:"version"`
	IsLogical         bool               `json:"logical" yaml:"logical"`
	IsCompound        bool               `json:"compound" yaml:"compound"`
	Icon              string             `json:"icon" yaml:"icon"`
	Endpoints         []*Endpoint        `json:"endpoints" yaml:"endpoints"`
	DataModels        []*DataModel       `json:"dataModels" yaml:"dataModels"`
	ChildDeviceModels []ChildDeviceModel `json:"childDeviceModels" yaml:"childDeviceModels"`
}

func ParseModelDefinition

func ParseModelDefinition(data []byte, dataType string) (*ModelDefinition, error)

type ModelPresentation

type ModelPresentation struct {
	Nodes      []*Node      `json:"nodes"`
	Connectors []*Connector `json:"connectors"`
}

func ParseModelPresentation

func ParseModelPresentation(data []byte, dataType string) (*ModelPresentation, error)

type Node

type Node struct {
	Id                 string      `json:"id"`
	Width              int32       `json:"width"`
	Height             int32       `json:"height"`
	X                  int32       `json:"x"`
	Y                  int32       `json:"y"`
	IsLeftConnectShow  bool        `json:"isLeftConnectShow"`
	IsRightConnectShow bool        `json:"isRightConnectShow"`
	Name               string      `json:"name"`
	IsSelect           bool        `json:"isSelect"`
	InitW              int32       `json:"initW"`
	InitH              int32       `json:"initH"`
	Type               string      `json:"type"`
	ContainNodes       []string    `json:"containNodes"`
	ClassType          string      `json:"classType"`
	Attrs              []*NodeAttr `json:"attrs"`
	Icon               string      `json:"icon"`
}

type NodeAttr

type NodeAttr struct {
	Type        string            `json:"type"`
	Name        string            `json:"name"`
	Value       interface{}       `json:"value"`
	Placeholder string            `json:"placeholder"`
	Disabled    bool              `json:"disabled"`
	Options     []*NodeAttrOption `json:"options"`
}

type NodeAttrOption

type NodeAttrOption struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type NodeSource

type NodeSource struct {
	Id     string `json:"id"`
	Width  int32  `json:"width"`
	Height int32  `json:"height"`
	X      int32  `json:"x"`
	Y      int32  `json:"y"`
}

Jump to

Keyboard shortcuts

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