format

package
v0.0.0-...-c94490f Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PLAIN_ID = "http://www.sepl.wifa.uni-leipzig.de/ontlogies/device-repo#PlainText"
	JSON_ID  = "http://www.sepl.wifa.uni-leipzig.de/ontlogies/device-repo#json"
	XML_ID   = "http://www.sepl.wifa.uni-leipzig.de/ontlogies/device-repo#xml"
)
View Source
const (
	XmlAttrFlag = "attr"
	XmlAnonym   = "anonym"
)

Variables

This section is empty.

Functions

func FormatToJson

func FormatToJson(config []model.ConfigField, value InputOutput) (result string, err error)

func FormatToJsonStruct

func FormatToJsonStruct(config []model.ConfigField, value InputOutput) (result interface{}, err error)

func FormatToPlainText

func FormatToPlainText(config []model.ConfigField, value InputOutput) (string, error)

func FormatToXml

func FormatToXml(config []model.ConfigField, value InputOutput, addidionalInfo []model.AdditionalFormatInfo) (result string, err error)

func GetFormatExample

func GetFormatExample(db interfaces.Persistence, formatInfo model.TypeAssignment) (result string, err error)

func GetFormatedValue

func GetFormatedValue(config []model.ConfigField, format string, value InputOutput, info []model.AdditionalFormatInfo) (result string, err error)

func UseDeviceConfig

func UseDeviceConfig(config []model.ConfigField, str string) string

func UseLiterals

func UseLiterals(value *InputOutput, valueType model.ValueType) (err error)

Types

type BpmnValueSkeleton

type BpmnValueSkeleton struct {
	Inputs  map[string]interface{} `json:"inputs,omitempty"`
	Outputs map[string]interface{} `json:"outputs,omitempty"`
}

func GetBpmnSkeleton

func GetBpmnSkeleton(db interfaces.Persistence, deviceInstanceId string, serviceId string) (result BpmnValueSkeleton, err error)

func GetBpmnSkeletonFromDeviceType

func GetBpmnSkeletonFromDeviceType(db interfaces.Persistence, deviceTypeId string, serviceId string) (result BpmnValueSkeleton, err error)

type InputOutput

type InputOutput struct {
	Name    string        `json:"name,omitempty"`
	FieldId string        `json:"field_id"`
	Type    Type          `json:"type"`
	Value   string        `json:"value,omitempty"`
	Values  []InputOutput `json:"values,omitempty"`
}

func ParseFormat

func ParseFormat(valueType model.ValueType, format string, value string, info []model.AdditionalFormatInfo) (result InputOutput, err error)

content of valueType.Fields may be changed

func ParseFromJson

func ParseFromJson(valueType model.ValueType, value string) (result InputOutput, err error)

func ParseFromJsonInterface

func ParseFromJsonInterface(valueType model.ValueType, valueInterface interface{}) (result InputOutput, err error)

func ParseFromPlainText

func ParseFromPlainText(valueType model.ValueType, value string) (result InputOutput, err error)

func ParseFromXml

func ParseFromXml(valueType model.ValueType, value string, infos []model.AdditionalFormatInfo) (result InputOutput, err error)

func SkeletonFromAssignment

func SkeletonFromAssignment(assignment model.TypeAssignment, allowedValues model.AllowedValues) (result InputOutput, err error)

type Leaf

type Leaf struct {
	Path string `json:"path"`
	Type string `json:"type"`
}

func GetLeaves

func GetLeaves(value map[string]interface{}) (result []Leaf, err error)

type LeavesResult

type LeavesResult struct {
	Example map[string]interface{} `json:"example"`
	Leaves  []Leaf                 `json:"leaves"`
}

func GetBpmnSkeletonOutputLeaves

func GetBpmnSkeletonOutputLeaves(db interfaces.Persistence, deviceInstanceId string, serviceId string) (result LeavesResult, err error)

type Type

type Type struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Desc string `json:"desc"`
	Base string `json:"base"`
}

type XmlInfo

type XmlInfo struct {
	Value          InputOutput
	AdditionalInfo []model.AdditionalFormatInfo

	Config []model.ConfigField
	// contains filtered or unexported fields
}

func (XmlInfo) Init

func (this XmlInfo) Init() XmlInfo

func (XmlInfo) MarshalXML

func (this XmlInfo) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

TODO chardata

Jump to

Keyboard shortcuts

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