Documentation ¶
Index ¶
- Constants
- func FormatToJson(config []model.ConfigField, value InputOutput) (result string, err error)
- func FormatToJsonStruct(config []model.ConfigField, value InputOutput) (result interface{}, err error)
- func FormatToPlainText(config []model.ConfigField, value InputOutput) (string, error)
- func FormatToXml(config []model.ConfigField, value InputOutput, ...) (result string, err error)
- func GetFormatedValue(config []model.ConfigField, format string, value InputOutput, ...) (result string, err error)
- func UseDeviceConfig(config []model.ConfigField, str string) string
- func UseLiterals(value *InputOutput, valueType model.ValueType) (err error)
- type EventMsg
- type EventTransformer
- func (this *EventTransformer) GetDevice(client HttpClient, deviceId string) (result model.DeviceInstance, err error)
- func (this *EventTransformer) GetDeviceType(client HttpClient, id string) (result model.DeviceType, err error)
- func (this *EventTransformer) Transform(event EventMsg) (result string, err error)
- type FormatedOutput
- type HttpClient
- type InputOutput
- func ParseFormat(valueType model.ValueType, format string, value string, ...) (result InputOutput, err error)
- func ParseFromJson(valueType model.ValueType, value string) (result InputOutput, err error)
- func ParseFromJsonInterface(valueType model.ValueType, valueInterface interface{}) (result InputOutput, err error)
- func ParseFromPlainText(valueType model.ValueType, value string) (result InputOutput, err error)
- func ParseFromXml(valueType model.ValueType, value string, infos []model.AdditionalFormatInfo) (result InputOutput, err error)
- type ProtocolPart
- type Type
- type XmlInfo
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 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 EventMsg ¶
type EventMsg []ProtocolPart
type EventTransformer ¶
type EventTransformer struct { Service model.Service IotRepoUrl string // contains filtered or unexported fields }
func NewTransformer ¶
func NewTransformer(iotRepo string, httpclient HttpClient, deviceid string, serviceid string) (transformer EventTransformer, err error)
func NewTransformerFromRouting ¶
func NewTransformerFromRouting(iotRepo string, httpclient HttpClient, routing string) (result EventTransformer, err error)
func (*EventTransformer) GetDevice ¶
func (this *EventTransformer) GetDevice(client HttpClient, deviceId string) (result model.DeviceInstance, err error)
func (*EventTransformer) GetDeviceType ¶
func (this *EventTransformer) GetDeviceType(client HttpClient, id string) (result model.DeviceType, err error)
type FormatedOutput ¶
type FormatedOutput map[string]interface{}
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)
type ProtocolPart ¶
type XmlInfo ¶
type XmlInfo struct { Value InputOutput AdditionalInfo []model.AdditionalFormatInfo Config []model.ConfigField // contains filtered or unexported fields }
func (XmlInfo) MarshalXML ¶
TODO chardata
Click to show internal directories.
Click to hide internal directories.