Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToReadingModel ¶
func ToReadingModel(r BaseReading, device string) models.Reading
Convert Reading DTO to Reading model
Types ¶
type BaseReading ¶
type BaseReading struct {
Id string `json:"id"`
Pushed int64 `json:"pushed,omitempty"`
Created int64 `json:"created"`
Origin int64 `json:"origin"`
Modified int64 `json:"modified,omitempty"`
Device string `json:"device"`
Name string `json:"name"`
Labels []string `json:"labels,omitempty"`
BinaryReading `json:",inline"`
SimpleReading `json:",inline"`
}
BaseReading defines the content of a reading object (usually generated by a device service) which can contain a SimpleReading or a BinaryReading (but not both). This object and its properties correspond to the BaseReading object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BaseReading
type BinaryReading ¶
type BinaryReading struct {
BinaryValue []byte `json:"binaryValue" validate:"required"`
MediaType string `json:"mediaType" validate:"required"`
}
BinaryReading defines the content of the binary form of a reading object (usually generated by a device service) This object and its properties correspond to the BinaryReading object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BinaryReading
type SimpleReading ¶
type SimpleReading struct {
Value string `json:"value" validate:"required"`
ValueType string `json:"valueType" validate:"required"`
FloatEncoding string `json:"floatEncoding,omitempty"`
}
SimpleReading defines the content of the simple reading object (usually generated by a device service) which can contain simple non-binary data types. This object and its properties correspond to the SimpleReading object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/SimpleReading