Documentation ¶
Index ¶
- func FromProtocolModelsToDTOs(protocolModels map[string]models.ProtocolProperties) map[string]ProtocolProperties
- func ToAddressModel(a Address) models.Address
- func ToAutoEventModel(a AutoEvent) models.AutoEvent
- func ToAutoEventModels(autoEventDTOs []AutoEvent) []models.AutoEvent
- func ToChannelModel(c Channel) models.Channel
- func ToChannelModels(channelDTOs []Channel) []models.Channel
- func ToCommandModel(c Command) models.Command
- func ToCommandModels(commandDTOs []Command) []models.Command
- func ToDeviceCommandModel(p DeviceCommand) models.DeviceCommand
- func ToDeviceCommandModels(deviceCommandDTOs []DeviceCommand) []models.DeviceCommand
- func ToDeviceModel(dto Device) models.Device
- func ToDeviceProfileModel(deviceProfileDTO DeviceProfile) models.DeviceProfile
- func ToDeviceResourceModel(d DeviceResource) models.DeviceResource
- func ToDeviceResourceModels(deviceResourceDTOs []DeviceResource) []models.DeviceResource
- func ToDeviceServiceModel(dto DeviceService) models.DeviceService
- func ToIntervalActionModel(dto IntervalAction) models.IntervalAction
- func ToIntervalModel(dto Interval) models.Interval
- func ToNotificationModel(n Notification) models.Notification
- func ToNotificationModels(notifications []Notification) []models.Notification
- func ToPropertyValueModel(p PropertyValue) models.PropertyValue
- func ToProtocolModels(protocolDTOs map[string]ProtocolProperties) map[string]models.ProtocolProperties
- func ToProtocolPropertiesModel(p ProtocolProperties) models.ProtocolProperties
- func ToProvisionWatcherModel(dto ProvisionWatcher) models.ProvisionWatcher
- func ToReadingModel(r BaseReading) models.Reading
- func ToResourceOperationModel(ro ResourceOperation) models.ResourceOperation
- func ToSubscriptionModel(s Subscription) models.Subscription
- func ToSubscriptionModels(subs []Subscription) []models.Subscription
- func ValidateDeviceProfileDTO(profile DeviceProfile) error
- type Address
- type AutoEvent
- type BaseReading
- func FromReadingModelToDTO(reading models.Reading) BaseReading
- func NewBinaryReading(profileName string, deviceName string, resourceName string, binaryValue []byte, ...) BaseReading
- func NewSimpleReading(profileName string, deviceName string, resourceName string, valueType string, ...) (BaseReading, error)
- type BinaryReading
- type Channel
- type Command
- type CoreCommand
- type Device
- type DeviceCommand
- type DeviceCoreCommand
- type DeviceProfile
- type DeviceResource
- type DeviceService
- type Event
- type Interval
- type IntervalAction
- type MQTTPubAddress
- type Notification
- type PropertyValue
- type ProtocolProperties
- type ProvisionWatcher
- type RESTAddress
- type ResourceOperation
- type SimpleReading
- type Subscription
- type UpdateDevice
- type UpdateDeviceService
- type UpdateInterval
- type UpdateIntervalAction
- type UpdateProvisionWatcher
- type UpdateSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromProtocolModelsToDTOs ¶
func FromProtocolModelsToDTOs(protocolModels map[string]models.ProtocolProperties) map[string]ProtocolProperties
FromProtocolModelsToDTOs transforms the Protocol model map to the Protocol DTO map
func ToAddressModel ¶
func ToAutoEventModel ¶
ToAutoEventModel transforms the AutoEvent DTO to the AutoEvent model
func ToAutoEventModels ¶
ToAutoEventModels transforms the AutoEvent DTO array to the AutoEvent model array
func ToChannelModel ¶
func ToChannelModels ¶
func ToCommandModel ¶
ToCommandModel transforms the Command DTO to the Command model
func ToCommandModels ¶
ToCommandModels transforms the Command DTOs to the Command models
func ToDeviceCommandModel ¶
func ToDeviceCommandModel(p DeviceCommand) models.DeviceCommand
ToDeviceCommandModel transforms the DeviceCommand DTO to the DeviceCommand model
func ToDeviceCommandModels ¶
func ToDeviceCommandModels(deviceCommandDTOs []DeviceCommand) []models.DeviceCommand
ToDeviceCommandModels transforms the DeviceCommand DTOs to the DeviceCommand models
func ToDeviceModel ¶
ToDeviceModel transforms the Device DTO to the Device Model
func ToDeviceProfileModel ¶
func ToDeviceProfileModel(deviceProfileDTO DeviceProfile) models.DeviceProfile
ToDeviceProfileModel transforms the DeviceProfile DTO to the DeviceProfile model
func ToDeviceResourceModel ¶
func ToDeviceResourceModel(d DeviceResource) models.DeviceResource
ToDeviceResourceModel transforms the DeviceResource DTO to the DeviceResource model
func ToDeviceResourceModels ¶
func ToDeviceResourceModels(deviceResourceDTOs []DeviceResource) []models.DeviceResource
ToDeviceResourceModels transforms the DeviceResource DTOs to the DeviceResource models
func ToDeviceServiceModel ¶
func ToDeviceServiceModel(dto DeviceService) models.DeviceService
ToDeviceServiceModel transforms the DeviceService DTO to the DeviceService Model
func ToIntervalActionModel ¶
func ToIntervalActionModel(dto IntervalAction) models.IntervalAction
ToIntervalActionModel transforms the IntervalAction DTO to the IntervalAction Model
func ToIntervalModel ¶
ToIntervalModel transforms the Interval DTO to the Interval Model
func ToNotificationModel ¶
func ToNotificationModel(n Notification) models.Notification
ToNotificationModel transforms the Notification DTO to the Notification Model
func ToNotificationModels ¶
func ToNotificationModels(notifications []Notification) []models.Notification
ToNotificationModels transforms the Notification DTO array to the Notification model array
func ToPropertyValueModel ¶
func ToPropertyValueModel(p PropertyValue) models.PropertyValue
ToPropertyValueModel transforms the PropertyValue DTO to the PropertyValue model
func ToProtocolModels ¶
func ToProtocolModels(protocolDTOs map[string]ProtocolProperties) map[string]models.ProtocolProperties
ToProtocolModels transforms the Protocol DTO map to the Protocol model map
func ToProtocolPropertiesModel ¶
func ToProtocolPropertiesModel(p ProtocolProperties) models.ProtocolProperties
ToPropertyValueModel transforms the ProtocolProperties DTO to the ProtocolProperties model
func ToProvisionWatcherModel ¶
func ToProvisionWatcherModel(dto ProvisionWatcher) models.ProvisionWatcher
ToProvisionWatcherModel transforms the ProvisionWatcher DTO to the ProvisionWatcher model
func ToReadingModel ¶
func ToReadingModel(r BaseReading) models.Reading
Convert Reading DTO to Reading model
func ToResourceOperationModel ¶
func ToResourceOperationModel(ro ResourceOperation) models.ResourceOperation
ToResourceOperationModel transforms the ResourceOperation DTO to the ResourceOperation model
func ToSubscriptionModel ¶
func ToSubscriptionModel(s Subscription) models.Subscription
ToSubscriptionModel transforms the Subscription DTO to the Subscription Model
func ToSubscriptionModels ¶
func ToSubscriptionModels(subs []Subscription) []models.Subscription
ToSubscriptionModels transforms the Subscription DTO array to the Subscription model array
func ValidateDeviceProfileDTO ¶
func ValidateDeviceProfileDTO(profile DeviceProfile) error
Types ¶
type Address ¶
type Address struct { Type string `json:"type" validate:"oneof='REST' 'MQTT'"` Host string `json:"host" validate:"required"` Port int `json:"port" validate:"required"` RESTAddress `json:",inline" validate:"-"` MQTTPubAddress `json:",inline" validate:"-"` }
func FromAddressModelToDTO ¶
type AutoEvent ¶
type AutoEvent struct { Frequency string `json:"frequency" validate:"required,edgex-dto-frequency"` OnChange bool `json:"onChange,omitempty"` SourceName string `json:"sourceName" validate:"required"` }
AutoEvent and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/AutoEvent
func FromAutoEventModelToDTO ¶
FromAutoEventModelToDTO transforms the AutoEvent model to the AutoEvent DTO
func FromAutoEventModelsToDTOs ¶
ToAutoEventModels transforms the AutoEvent model array to the AutoEvent DTO array
type BaseReading ¶
type BaseReading struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty"` Created int64 `json:"created,omitempty"` Origin int64 `json:"origin" validate:"required"` DeviceName string `json:"deviceName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` ResourceName string `json:"resourceName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` ProfileName string `json:"profileName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` ValueType string `json:"valueType" validate:"required,edgex-dto-value-type"` BinaryReading `json:",inline" validate:"-"` SimpleReading `json:",inline" validate:"-"` }
BaseReading and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BaseReading
func FromReadingModelToDTO ¶
func FromReadingModelToDTO(reading models.Reading) BaseReading
func NewBinaryReading ¶
func NewBinaryReading(profileName string, deviceName string, resourceName string, binaryValue []byte, mediaType string) BaseReading
NewBinaryReading creates and returns a new initialized BaseReading with its BinaryReading initialized
func NewSimpleReading ¶
func NewSimpleReading(profileName string, deviceName string, resourceName string, valueType string, value interface{}) (BaseReading, error)
NewSimpleReading creates and returns a new initialized BaseReading with its SimpleReading initialized
func (BaseReading) Validate ¶
func (b BaseReading) Validate() error
Validate satisfies the Validator interface
type BinaryReading ¶
type BinaryReading struct { BinaryValue []byte `json:"binaryValue" validate:"gt=0,required"` MediaType string `json:"mediaType" validate:"required"` }
BinaryReading and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BinaryReading
type Channel ¶
type Channel struct { Type string `json:"type" validate:"required,oneof='REST' 'EMAIL'"` EmailAddresses []string `json:"emailAddresses,omitempty" validate:"omitempty,required_without=Url,gt=0,dive,email"` Url string `json:"url,omitempty" validate:"omitempty,required_without=EmailAddresses,uri"` }
Channel and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-notifications/2.x#/Channel
func FromChannelModelToDTO ¶
FromChannelModelToDTO transforms the Channel model to the Channel DTO
func FromChannelModelsToDTOs ¶
FromChannelModelsToDTOs transforms the Channel model array to the Channel DTO array
type Command ¶
type Command struct { Name string `json:"name" yaml:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Get bool `json:"get,omitempty" yaml:"get,omitempty" validate:"required_without=Set"` Set bool `json:"set,omitempty" yaml:"set,omitempty" validate:"required_without=Get"` }
Command and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/Command
func FromCommandModelToDTO ¶
FromCommandModelToDTO transforms the Command model to the Command DTO
func FromCommandModelsToDTOs ¶
FromCommandModelsToDTOs transforms the Command models to the Command DTOs
type CoreCommand ¶
type CoreCommand struct { Name string `json:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Get bool `json:"get,omitempty" validate:"required_without=Set"` Set bool `json:"set,omitempty" validate:"required_without=Get"` Path string `json:"path,omitempty"` Url string `json:"url,omitempty"` }
CoreCommand and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-command/2.x#/CoreCommand
type Device ¶
type Device struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Created int64 `json:"created,omitempty"` Modified int64 `json:"modified,omitempty"` Name string `json:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Description string `json:"description,omitempty"` AdminState string `json:"adminState" validate:"oneof='LOCKED' 'UNLOCKED'"` OperatingState string `json:"operatingState" validate:"oneof='UP' 'DOWN' 'UNKNOWN'"` LastConnected int64 `json:"lastConnected,omitempty"` LastReported int64 `json:"lastReported,omitempty"` Labels []string `json:"labels,omitempty"` Location interface{} `json:"location,omitempty"` ServiceName string `json:"serviceName" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` ProfileName string `json:"profileName" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` AutoEvents []AutoEvent `json:"autoEvents,omitempty" validate:"dive"` Protocols map[string]ProtocolProperties `json:"protocols" validate:"required,gt=0"` }
Device and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/Device
func FromDeviceModelToDTO ¶
FromDeviceModelToDTO transforms the Device Model to the Device DTO
type DeviceCommand ¶
type DeviceCommand struct { Name string `json:"name" yaml:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Get []ResourceOperation `json:"get,omitempty" yaml:"get,omitempty" validate:"required_without=Set"` Set []ResourceOperation `json:"set,omitempty" yaml:"set,omitempty" validate:"required_without=Get"` }
DeviceCommand and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceCommand
func FromDeviceCommandModelToDTO ¶
func FromDeviceCommandModelToDTO(p models.DeviceCommand) DeviceCommand
FromDeviceCommandModelToDTO transforms the DeviceCommand model to the DeviceCommand DTO
func FromDeviceCommandModelsToDTOs ¶
func FromDeviceCommandModelsToDTOs(deviceCommandModels []models.DeviceCommand) []DeviceCommand
FromDeviceCommandModelsToDTOs transforms the DeviceCommand models to the DeviceCommand DTOs
type DeviceCoreCommand ¶
type DeviceCoreCommand struct { DeviceName string `json:"deviceName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` ProfileName string `json:"profileName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` CoreCommands []CoreCommand `json:"coreCommands,omitempty" validate:"dive"` }
DeviceCoreCommand and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-command/2.x#/DeviceCoreCommand
type DeviceProfile ¶
type DeviceProfile struct { common.Versionable `json:",inline" yaml:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Name string `json:"name" yaml:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Manufacturer string `json:"manufacturer,omitempty" yaml:"manufacturer,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Model string `json:"model,omitempty" yaml:"model,omitempty"` Labels []string `json:"labels,omitempty" yaml:"labels,flow,omitempty"` DeviceResources []DeviceResource `json:"deviceResources" yaml:"deviceResources" validate:"required,gt=0,dive"` DeviceCommands []DeviceCommand `json:"deviceCommands,omitempty" yaml:"deviceCommands,omitempty" validate:"dive"` CoreCommands []Command `json:"coreCommands,omitempty" yaml:"coreCommands,omitempty" validate:"dive"` }
DeviceProfile and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceProfile
func FromDeviceProfileModelToDTO ¶
func FromDeviceProfileModelToDTO(deviceProfile models.DeviceProfile) DeviceProfile
FromDeviceProfileModelToDTO transforms the DeviceProfile Model to the DeviceProfile DTO
func (*DeviceProfile) UnmarshalYAML ¶
func (dp *DeviceProfile) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface for the DeviceProfile type
func (*DeviceProfile) Validate ¶
func (dp *DeviceProfile) Validate() error
Validate satisfies the Validator interface
type DeviceResource ¶
type DeviceResource struct { Description string `json:"description,omitempty" yaml:"description,omitempty"` Name string `json:"name" yaml:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Tag string `json:"tag,omitempty" yaml:"tag,omitempty"` Properties PropertyValue `json:"properties,omitempty" yaml:"properties,omitempty"` Attributes map[string]string `json:"attributes,omitempty" yaml:"attributes,omitempty"` }
DeviceResource and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceResource
func FromDeviceResourceModelToDTO ¶
func FromDeviceResourceModelToDTO(d models.DeviceResource) DeviceResource
FromDeviceResourceModelToDTO transforms the DeviceResource model to the DeviceResource DTO
func FromDeviceResourceModelsToDTOs ¶
func FromDeviceResourceModelsToDTOs(deviceResourceModels []models.DeviceResource) []DeviceResource
FromDeviceResourceModelsToDTOs transforms the DeviceResource models to the DeviceResource DTOs
type DeviceService ¶
type DeviceService struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Name string `json:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Created int64 `json:"created,omitempty"` Modified int64 `json:"modified,omitempty"` Description string `json:"description,omitempty"` LastConnected int64 `json:"lastConnected,omitempty"` LastReported int64 `json:"lastReported,omitempty"` Labels []string `json:"labels,omitempty"` BaseAddress string `json:"baseAddress" validate:"required,uri"` AdminState string `json:"adminState" validate:"oneof='LOCKED' 'UNLOCKED'"` }
DeviceService and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceService
func FromDeviceServiceModelToDTO ¶
func FromDeviceServiceModelToDTO(ds models.DeviceService) DeviceService
FromDeviceServiceModelToDTO transforms the DeviceService Model to the DeviceService DTO
type Event ¶
type Event struct { common.Versionable `json:",inline"` Id string `json:"id" validate:"required,uuid"` DeviceName string `json:"deviceName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` ProfileName string `json:"profileName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` SourceName string `json:"sourceName" validate:"required,edgex-dto-rfc3986-unreserved-chars"` Created int64 `json:"created,omitempty"` Origin int64 `json:"origin" validate:"required"` Readings []BaseReading `json:"readings" validate:"gt=0,dive,required"` Tags map[string]string `json:"tags,omitempty" xml:"-"` // Have to ignore since map not supported for XML }
Event and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/Event
func FromEventModelToDTO ¶
FromEventModelToDTO transforms the Event Model to the Event DTO
func (*Event) AddBinaryReading ¶
AddBinaryReading adds a binary reading to the Event
func (*Event) AddSimpleReading ¶
AddSimpleReading adds a simple reading to the Event
type Interval ¶
type Interval struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Created int64 `json:"created,omitempty"` Modified int64 `json:"modified,omitempty"` Name string `json:"name" validate:"edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Start string `json:"start,omitempty" validate:"omitempty,edgex-dto-interval-datetime"` End string `json:"end,omitempty" validate:"omitempty,edgex-dto-interval-datetime"` Frequency string `json:"frequency" validate:"required,edgex-dto-frequency"` RunOnce bool `json:"runOnce,omitempty"` }
Interval and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-scheduler/2.x#/Interval
func FromIntervalModelToDTO ¶
FromIntervalModelToDTO transforms the Interval Model to the Interval DTO
type IntervalAction ¶
type IntervalAction struct { common.Versionable `json:",inline"` Created int64 `json:"created,omitempty"` Modified int64 `json:"modified,omitempty"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Name string `json:"name" validate:"edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` IntervalName string `json:"intervalName" validate:"edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Protocol string `json:"protocol,omitempty"` Host string `json:"host,omitempty"` Port int `json:"port,omitempty"` Path string `json:"path,omitempty"` Parameters string `json:"parameters,omitempty"` HTTPMethod string `json:"httpMethod,omitempty" validate:"omitempty,oneof='GET' 'HEAD' 'POST' 'PUT' 'DELETE' 'TRACE' 'CONNECT'"` User string `json:"user,omitempty"` Password string `json:"password,omitempty"` Publisher string `json:"publisher,omitempty"` Target string `json:"target" validate:"edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Topic string `json:"topic,omitempty"` }
IntervalAction and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-scheduler/2.x#/IntervalAction
func FromIntervalActionModelToDTO ¶
func FromIntervalActionModelToDTO(model models.IntervalAction) IntervalAction
FromIntervalActionModelToDTO transforms the IntervalAction Model to the IntervalAction DTO
type MQTTPubAddress ¶
type MQTTPubAddress struct { Publisher string `json:"publisher" validate:"required"` Topic string `json:"topic" validate:"required"` QoS int `json:"qos,omitempty"` KeepAlive int `json:"keepAlive,omitempty"` Retained bool `json:"retained,omitempty"` AutoReconnect bool `json:"autoReconnect,omitempty"` ConnectTimeout int `json:"connectTimeout,omitempty"` }
type Notification ¶
type Notification struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Created int64 `json:"created,omitempty"` Modified int64 `json:"modified,omitempty"` Category string `` /* 133-byte string literal not displayed */ Labels []string `` /* 143-byte string literal not displayed */ Content string `json:"content" validate:"required,edgex-dto-none-empty-string"` ContentType string `json:"contentType,omitempty"` Description string `json:"description,omitempty"` Sender string `json:"sender" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Severity string `json:"severity" validate:"required,oneof='MINOR' 'NORMAL' 'CRITICAL'"` Status string `json:"status,omitempty" validate:"omitempty,oneof='NEW' 'PROCESSED' 'ESCALATED'"` }
Notification and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-notifications/2.x#/Notification
func FromNotificationModelToDTO ¶
func FromNotificationModelToDTO(n models.Notification) Notification
FromNotificationModelToDTO transforms the Notification Model to the Notification DTO
func FromNotificationModelsToDTOs ¶
func FromNotificationModelsToDTOs(notifications []models.Notification) []Notification
FromNotificationModelsToDTOs transforms the Notification model array to the Notification DTO array
func NewNotification ¶
func NewNotification(labels []string, category, content, sender, severity string) Notification
NewNotification creates and returns a Notification DTO
type PropertyValue ¶
type PropertyValue struct { ValueType string `json:"valueType" yaml:"valueType" validate:"required,edgex-dto-value-type"` ReadWrite string `json:"readWrite,omitempty" yaml:"readWrite,omitempty"` Units string `json:"units,omitempty" yaml:"units,omitempty"` Minimum string `json:"minimum,omitempty" yaml:"minimum,omitempty"` Maximum string `json:"maximum,omitempty" yaml:"maximum,omitempty"` DefaultValue string `json:"defaultValue,omitempty" yaml:"defaultValue,omitempty"` Mask string `json:"mask,omitempty" yaml:"mask,omitempty"` Shift string `json:"shift,omitempty" yaml:"shift,omitempty"` Scale string `json:"scale,omitempty" yaml:"scale,omitempty"` Offset string `json:"offset,omitempty" yaml:"offset,omitempty"` Base string `json:"base,omitempty" yaml:"base,omitempty"` Assertion string `json:"assertion,omitempty" yaml:"assertion,omitempty"` MediaType string `json:"mediaType,omitempty" yaml:"mediaType,omitempty"` }
PropertyValue and its properties care defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/PropertyValue
func FromPropertyValueModelToDTO ¶
func FromPropertyValueModelToDTO(p models.PropertyValue) PropertyValue
FromPropertyValueModelToDTO transforms the PropertyValue Model to the PropertyValue DTO
type ProtocolProperties ¶
ProtocolProperties contains the device connection information in key/value pair
func FromProtocolPropertiesModelToDTO ¶
func FromProtocolPropertiesModelToDTO(p models.ProtocolProperties) ProtocolProperties
FromProtocolPropertiesModelToDTO transforms the ProtocolProperties model to the ProtocolProperties DTO
type ProvisionWatcher ¶
type ProvisionWatcher struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Name string `json:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Labels []string `json:"labels,omitempty"` Identifiers map[string]string `json:"identifiers" validate:"gt=0,dive,keys,required,endkeys,required"` BlockingIdentifiers map[string][]string `json:"blockingIdentifiers,omitempty"` ProfileName string `json:"profileName" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` ServiceName string `json:"serviceName" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` AdminState string `json:"adminState" validate:"oneof='LOCKED' 'UNLOCKED'"` AutoEvents []AutoEvent `json:"autoEvents,omitempty" validate:"dive"` }
ProvisionWatcher and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/ProvisionWatcher
func FromProvisionWatcherModelToDTO ¶
func FromProvisionWatcherModelToDTO(pw models.ProvisionWatcher) ProvisionWatcher
FromProvisionWatcherModelToDTO transforms the ProvisionWatcher Model to the ProvisionWatcher DTO
type RESTAddress ¶
type ResourceOperation ¶
type ResourceOperation struct { DeviceResource string `json:"deviceResource" yaml:"deviceResource" validate:"required"` // The replacement of Object field Parameter string `json:"parameter,omitempty" yaml:"parameter,omitempty"` Mappings map[string]string `json:"mappings,omitempty" yaml:"mappings,omitempty"` }
ResourceOperation and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/ResourceOperation
func FromResourceOperationModelToDTO ¶
func FromResourceOperationModelToDTO(ro models.ResourceOperation) ResourceOperation
FromResourceOperationModelToDTO transforms the ResourceOperation model to the ResourceOperation DTO
type SimpleReading ¶
type SimpleReading struct {
Value string `json:"value" validate:"required"`
}
SimpleReading and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/SimpleReading
type Subscription ¶
type Subscription struct { common.Versionable `json:",inline"` Id string `json:"id,omitempty" validate:"omitempty,uuid"` Name string `json:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Channels []Channel `json:"channels" validate:"required,gt=0,dive"` Receiver string `json:"receiver" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Categories []string `` /* 145-byte string literal not displayed */ Labels []string `` /* 145-byte string literal not displayed */ Created int64 `json:"created,omitempty"` Modified int64 `json:"modified,omitempty"` Description string `json:"description,omitempty"` ResendLimit int64 `json:"resendLimit,omitempty"` ResendInterval string `json:"resendInterval,omitempty" validate:"omitempty,edgex-dto-frequency"` }
Subscription and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-notifications/2.x#/Subscription
func FromSubscriptionModelToDTO ¶
func FromSubscriptionModelToDTO(s models.Subscription) Subscription
FromSubscriptionModelToDTO transforms the Subscription Model to the Subscription DTO
func FromSubscriptionModelsToDTOs ¶
func FromSubscriptionModelsToDTOs(subscruptions []models.Subscription) []Subscription
FromSubscriptionModels transforms the Subscription model array to the Subscription DTO array
type UpdateDevice ¶
type UpdateDevice struct { common.Versionable `json:",inline"` Id *string `json:"id" validate:"required_without=Name,edgex-dto-uuid"` Name *string `json:"name" validate:"required_without=Id,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Description *string `json:"description,omitempty" validate:"omitempty,edgex-dto-none-empty-string"` AdminState *string `json:"adminState,omitempty" validate:"omitempty,oneof='LOCKED' 'UNLOCKED'"` OperatingState *string `json:"operatingState,omitempty" validate:"omitempty,oneof='UP' 'DOWN' 'UNKNOWN'"` LastConnected *int64 `json:"lastConnected,omitempty"` LastReported *int64 `json:"lastReported,omitempty"` ServiceName *string `json:"serviceName,omitempty" validate:"omitempty,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` ProfileName *string `json:"profileName,omitempty" validate:"omitempty,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Labels []string `json:"labels,omitempty"` Location interface{} `json:"location,omitempty"` AutoEvents []AutoEvent `json:"autoEvents,omitempty" validate:"dive"` Protocols map[string]ProtocolProperties `json:"protocols,omitempty" validate:"omitempty,gt=0"` Notify *bool `json:"notify,omitempty"` }
UpdateDevice and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/UpdateDevice
func FromDeviceModelToUpdateDTO ¶
func FromDeviceModelToUpdateDTO(d models.Device) UpdateDevice
FromDeviceModelToUpdateDTO transforms the Device Model to the UpdateDevice DTO
type UpdateDeviceService ¶
type UpdateDeviceService struct { common.Versionable `json:",inline"` Id *string `json:"id" validate:"required_without=Name,edgex-dto-uuid"` Name *string `json:"name" validate:"required_without=Id,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` BaseAddress *string `json:"baseAddress" validate:"omitempty,uri"` Labels []string `json:"labels"` AdminState *string `json:"adminState" validate:"omitempty,oneof='LOCKED' 'UNLOCKED'"` }
UpdateDeviceService and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/UpdateDeviceService
func FromDeviceServiceModelToUpdateDTO ¶
func FromDeviceServiceModelToUpdateDTO(ds models.DeviceService) UpdateDeviceService
FromDeviceServiceModelToUpdateDTO transforms the DeviceService Model to the UpdateDeviceService DTO
type UpdateInterval ¶
type UpdateInterval struct { common.Versionable `json:",inline"` Id *string `json:"id" validate:"required_without=Name,edgex-dto-uuid"` Name *string `json:"name" validate:"required_without=Id,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Start *string `json:"start,omitempty" validate:"omitempty,edgex-dto-interval-datetime"` End *string `json:"end,omitempty" validate:"omitempty,edgex-dto-interval-datetime"` Frequency *string `json:"frequency,omitempty" validate:"omitempty,edgex-dto-frequency"` RunOnce *bool `json:"runOnce,omitempty"` }
UpdateInterval and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-scheduler/2.x#/UpdateInterval
type UpdateIntervalAction ¶
type UpdateIntervalAction struct { common.Versionable `json:",inline"` Id *string `json:"id" validate:"required_without=Name,edgex-dto-uuid"` Name *string `json:"name" validate:"required_without=Id,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` IntervalName *string `json:"intervalName" validate:"edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Protocol *string `json:"protocol,omitempty"` Host *string `json:"host,omitempty"` Port *int `json:"port,omitempty"` Path *string `json:"path,omitempty"` Parameters *string `json:"parameters,omitempty"` HTTPMethod *string `json:"httpMethod,omitempty" validate:"omitempty,oneof='GET' 'HEAD' 'POST' 'PUT' 'DELETE' 'TRACE' 'CONNECT'"` User *string `json:"user,omitempty"` Password *string `json:"password,omitempty"` Publisher *string `json:"publisher,omitempty"` Target *string `json:"target,omitempty" validate:"omitempty,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Topic *string `json:"topic,omitempty"` }
UpdateIntervalAction and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-scheduler/2.x#/UpdateIntervalAction
type UpdateProvisionWatcher ¶
type UpdateProvisionWatcher struct { common.Versionable `json:",inline"` Id *string `json:"id" validate:"required_without=Name,edgex-dto-uuid"` Name *string `json:"name" validate:"required_without=Id,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Labels []string `json:"labels"` Identifiers map[string]string `json:"identifiers" validate:"omitempty,gt=0,dive,keys,required,endkeys,required"` BlockingIdentifiers map[string][]string `json:"blockingIdentifiers"` ProfileName *string `json:"profileName" validate:"omitempty,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` ServiceName *string `json:"serviceName" validate:"omitempty,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` AdminState *string `json:"adminState" validate:"omitempty,oneof='LOCKED' 'UNLOCKED'"` AutoEvents []AutoEvent `json:"autoEvents" validate:"dive"` }
UpdateProvisionWatcher and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/UpdateProvisionWatcher
func FromProvisionWatcherModelToUpdateDTO ¶
func FromProvisionWatcherModelToUpdateDTO(pw models.ProvisionWatcher) UpdateProvisionWatcher
FromProvisionWatcherModelToUpdateDTO transforms the ProvisionWatcher Model to the UpdateProvisionWatcher DTO
type UpdateSubscription ¶
type UpdateSubscription struct { common.Versionable `json:",inline"` Id *string `json:"id,omitempty" validate:"required_without=Name,edgex-dto-uuid"` Name *string `json:"name,omitempty" validate:"required_without=Id,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Channels []Channel `json:"channels,omitempty" validate:"omitempty,dive"` Receiver *string `json:"receiver,omitempty" validate:"omitempty,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Categories []string `json:"categories,omitempty" validate:"omitempty,dive,gt=0,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Labels []string `json:"labels,omitempty" validate:"omitempty,dive,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"` Description *string `json:"description,omitempty"` ResendLimit *int64 `json:"resendLimit,omitempty"` ResendInterval *string `json:"resendInterval,omitempty" validate:"omitempty,edgex-dto-frequency"` }
UpdateSubscription and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/support-notifications/2.x#/UpdateSubscription