dtos

package
v0.1.65 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 2 Imported by: 35

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 {
	common.Versionable `json:",inline"`
	Id                 string   `json:"id"`
	Pushed             int64    `json:"pushed,omitempty"`
	Created            int64    `json:"created"`
	Origin             int64    `json:"origin"`
	Modified           int64    `json:"modified,omitempty"`
	DeviceName         string   `json:"deviceName"`
	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

func FromReadingModelToDTO added in v0.1.65

func FromReadingModelToDTO(reading models.Reading) 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 Event added in v0.1.65

type Event struct {
	common.Versionable `json:",inline"`
	ID                 string        `json:"id"`
	Pushed             int64         `json:"pushed,omitempty"`
	DeviceName         string        `json:"deviceName"`
	Created            int64         `json:"created"`
	Modified           int64         `json:"modified,omitempty"`
	Origin             int64         `json:"origin"`
	Readings           []BaseReading `json:"readings"`
}

Event represents a single measurable event read from a device This object and its properties correspond to the Event object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/Event

func FromEventModelToDTO added in v0.1.65

func FromEventModelToDTO(event models.Event) Event

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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