Documentation ¶
Index ¶
- Constants
- func IsAdminStateType(as string) bool
- func IsChannelType(as string) bool
- func IsNotificationsCategory(as string) bool
- func IsNotificationsSeverity(as string) bool
- func IsNotificationsStatus(as string) bool
- func IsOperatingStateType(os string) bool
- func IsTransmissionStatus(as string) bool
- type Action
- type ActionType
- type Addressable
- type AdminState
- type AutoEvent
- type BaseObject
- type CallbackAlert
- type Channel
- type ChannelType
- type Command
- type CommandResponse
- type DescribedObject
- type Device
- type DeviceProfile
- type DeviceResource
- type DeviceService
- type EncryptionDetails
- type Event
- type Filter
- type Get
- type Interval
- type IntervalAction
- type LogEntry
- type Notification
- type NotificationsCategory
- type NotificationsSeverity
- type NotificationsStatus
- type NotifyUpdate
- type OperatingState
- type Operation
- type ProfileProperty
- type ProfileResource
- type PropertyValue
- type ProtocolProperties
- type ProvisionWatcher
- type Put
- type Reading
- type Registration
- type ResourceOperation
- type Response
- type Service
- type Subscription
- type Transmission
- type TransmissionRecord
- type TransmissionStatus
- type Units
Constants ¶
const ( PROFILE = "PROFILE" DEVICE = "DEVICE" SERVICE = "SERVICE" SCHEDULE = "SCHEDULE" SCHEDULEEVENT = "SCHEDULEEVENT" ADDRESSABLE = "ADDRESSABLE" VALUEDESCRIPTOR = "VALUEDESCRIPTOR" PROVISIONWATCHER = "PROVISIONWATCHER" REPORT = "REPORT" )
const ( // Locked : device is locked // Unlocked : device is unlocked Locked = "LOCKED" Unlocked = "UNLOCKED" )
const ( Security = "SECURITY" Hwhealth = "HW_HEALTH" Swhealth = "SW_HEALTH" )
const ( Rest = "REST" Email = "EMAIL" )
const ( EncNone = "NONE" EncAes = "AES" )
Encryption types
const ( Enabled = "ENABLED" Disabled = "DISABLED" )
Enabled : ENABLED Disabled : DISABLED
const ( DestMQTT = "MQTT_TOPIC" DestZMQ = "ZMQ_TOPIC" DestIotCoreMQTT = "IOTCORE_TOPIC" DestAzureMQTT = "AZURE_TOPIC" DestRest = "REST_ENDPOINT" DestXMPP = "XMPP_TOPIC" DestAWSMQTT = "AWS_TOPIC" )
Export destination types
const ( CompNone = "NONE" CompGzip = "GZIP" CompZip = "ZIP" )
Compression algorithm types
const ( FormatJSON = "JSON" FormatXML = "XML" FormatSerialized = "SERIALIZED" FormatIoTCoreJSON = "IOTCORE_JSON" FormatAzureJSON = "AZURE_JSON" FormatAWSJSON = "AWS_JSON" FormatCSV = "CSV" FormatThingsBoardJSON = "THINGSBOARD_JSON" FormatNOOP = "NOOP" )
Data format types
const ( NotifyUpdateAdd = "add" NotifyUpdateUpdate = "update" NotifyUpdateDelete = "delete" )
const ( Critical = "CRITICAL" Normal = "NORMAL" )
const ( New = "NEW" Processed = "PROCESSED" Escalated = "ESCALATED" )
const ( Failed = "FAILED" Sent = "SENT" Acknowledged = "ACKNOWLEDGED" Trxescalated = "TRXESCALATED" )
Variables ¶
This section is empty.
Functions ¶
func IsAdminStateType ¶
func IsChannelType ¶
func IsNotificationsCategory ¶
func IsNotificationsSeverity ¶
func IsNotificationsStatus ¶
func IsOperatingStateType ¶
IsOperatingStateType : return if ostype
func IsTransmissionStatus ¶
Types ¶
type Action ¶
type Action struct { Path string `json:"path" yaml:"path,omitempty"` // path used by service for action on a device or sensor Responses []Response `json:"responses" yaml:"responses,omitempty"` // responses from get or put requests to service URL string `json:"url,omitempty" yaml:"url,omitempty"` // url for requests from command service }
type ActionType ¶
type ActionType string
type Addressable ¶
type Addressable struct { BaseObject Id string `json:"id"` Name string `json:"name"` Protocol string `json:"protocol"` // Protocol for the address (HTTP/TCP) HTTPMethod string `json:"method"` // Method for connecting (i.e. POST) Address string `json:"address"` // Address of the addressable Port int `json:"port"` // Port for the address Path string `json:"path"` // Path for callbacks Publisher string `json:"publisher"` // For message bus protocols User string `json:"user"` // User id for authentication Password string `json:"password"` // Password of the user for authentication for the addressable Topic string `json:"topic"` // Topic for message bus addressables Certificate string `json:"certificate"` // Certificate used for authentication }
* This file is the model for addressable in EdgeX * Addressable holds information about a specific address * * Addressable struct
func (Addressable) GetBaseURL ¶
func (a Addressable) GetBaseURL() string
func (Addressable) GetCallbackURL ¶
func (a Addressable) GetCallbackURL() string
Get the callback url for the addressable if all relevant tokens have values. If any token is missing, string will be empty
func (Addressable) MarshalJSON ¶
func (a Addressable) MarshalJSON() ([]byte, error)
Custom marshaling for JSON Treat the strings as pointers so they can be null in JSON
type AdminState ¶
type AdminState string
AdminState : unlocked or locked
func GetAdminState ¶
func GetAdminState(as string) (AdminState, bool)
func (*AdminState) UnmarshalJSON ¶
func (as *AdminState) UnmarshalJSON(data []byte) error
* Unmarshal the enum type
type AutoEvent ¶
type AutoEvent struct { // Frequency indicates how often the specific resource needs to be polled. // It represents as a duration string. // The format of this field is to be an unsigned integer followed by a unit which may be "ms", "s", "m" or "h" // representing milliseconds, seconds, minutes or hours. Eg, "100ms", "24h" Frequency string `json:"frequency,omitempty"` // OnChange indicates whether the device service will generate an event only, // if the reading value is different from the previous one. // If true, only generate events when readings change OnChange bool `json:"onChange,omitempty"` // Resource indicates the name of the resource in the device profile which describes the event to generate Resource string `json:"resource,omitempty"` // AverageValue selects if we are to calculate and send the average value for the frequency integration period from the selected resource AverageValue bool `json:"averageValue,omitempty"` // MinValue selects if we are to store and send the minimum value read for the frequency integration period from the selected resource MinValue bool `json:"minValue,omitempty"` // MaxValue selects if we are to store and send the maximum value read for the frequency integration period from the selected resource MaxValue bool `json:"maxValue,omitempty"` }
AutoEvent supports auto-generated events sourced from a device service
type BaseObject ¶
type BaseObject struct { Created int64 `json:"created,omitempty" yaml:"created,omitempty"` Modified int64 `json:"modified,omitempty" yaml:"modified,omitempty"` Origin int64 `json:"origin,omitempty" yaml:"origin,omitempty"` }
func (*BaseObject) String ¶
func (o *BaseObject) String() string
* String function for representing a device
type CallbackAlert ¶
type CallbackAlert struct { ActionType ActionType `json:"type"` Id string `json:"id"` }
func (CallbackAlert) MarshalJSON ¶
func (ca CallbackAlert) MarshalJSON() ([]byte, error)
Custom JSON marshaling to turn empty strings into null pointers
func (CallbackAlert) String ¶
func (ca CallbackAlert) String() string
type Channel ¶
type Channel struct { Type ChannelType `json:"type,omitempty"` MailAddresses []string `json:"mailAddresses,omitempty"` Url string `json:"url,omitempty"` }
TODO - this is ugly and I want to someday have two different structs of EMailChannel and RESTChannel
type ChannelType ¶
type ChannelType string
func (*ChannelType) UnmarshalJSON ¶
func (as *ChannelType) UnmarshalJSON(data []byte) error
type Command ¶
type Command struct { BaseObject `yaml:",inline"` Id string `json:"id" yaml:"id,omitempty"` Name string `json:"name" yaml:"name,omitempty"` // Command name (unique on the profile) Get *Get `json:"get" yaml:"get,omitempty"` // Get Command Put *Put `json:"put" yaml:"put,omitempty"` // Put Command }
* This file is the model for a command in EdgeX * * * Command struct
func (Command) MarshalJSON ¶
Custom marshaling for making empty strings null
func (*Command) UnmarshalJSON ¶
type CommandResponse ¶
type CommandResponse struct { Id string `json:"id"` Name string `json:"name"` // Unique name for identifying a device AdminState AdminState `json:"adminState"` // Admin state (locked/unlocked) OperatingState OperatingState `json:"operatingState"` // Operating state (enabled/disabled) LastConnected int64 `json:"lastConnected"` // Time (milliseconds) that the device last provided any feedback or responded to any request LastReported int64 `json:"lastReported"` // Time (milliseconds) that the device reported data to the core microservice Labels []string `json:"labels"` // Other labels applied to the device to help with searching Location interface{} `json:"location"` // Device service specific location (interface{} is an empty interface so it can be anything) Commands []Command `json:"commands"` // Associated Device Profile - Describes the device }
* This file is the model for the CommandResponse object in EdgeX * * * CommandResponse struct
func CommandResponseFromDevice ¶
func CommandResponseFromDevice(d Device, cmdURL string) CommandResponse
* Create a Command Response struct from a Device Struct
func (CommandResponse) MarshalJSON ¶
func (cr CommandResponse) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (CommandResponse) String ¶
func (d CommandResponse) String() string
* String function for representing a device
type DescribedObject ¶
type DescribedObject struct { BaseObject `yaml:",inline"` Description string `json:"description" yaml:"description,omitempty"` }
func (DescribedObject) String ¶
func (o DescribedObject) String() string
* String function for DescribedObject
type Device ¶
type Device struct { DescribedObject Id string `json:"id"` Name string `json:"name"` // Unique name for identifying a device AdminState AdminState `json:"adminState"` // Admin state (locked/unlocked) OperatingState OperatingState `json:"operatingState"` // Operating state (enabled/disabled) Protocols map[string]ProtocolProperties `json:"protocols"` // A map of supported protocols for the given device LastConnected int64 `json:"lastConnected"` // Time (milliseconds) that the device last provided any feedback or responded to any request LastReported int64 `json:"lastReported"` // Time (milliseconds) that the device reported data to the core microservice Labels []string `json:"labels"` // Other labels applied to the device to help with searching Location interface{} `json:"location"` // Device service specific location (interface{} is an empty interface so it can be anything) Service DeviceService `json:"service"` // Associated Device Service - One per device Profile DeviceProfile `json:"profile"` // Associated Device Profile - Describes the device AutoEvents []AutoEvent `json:"autoEvents"` // A list of auto-generated events coming from the device }
* This file is the model for the Device object in EdgeX * * * Device struct
func (Device) MarshalJSON ¶
Custom marshaling to make empty strings null
type DeviceProfile ¶
type DeviceProfile struct { DescribedObject `yaml:",inline"` Id string `json:"id" yaml:"id,omitempty"` Name string `json:"name" yaml:"name,omitempty"` // Non-database identifier (must be unique) Manufacturer string `json:"manufacturer" yaml:"manufacturer,omitempty"` // Manufacturer of the device Model string `json:"model" yaml:"model,omitempty"` // Model of the device Labels []string `json:"labels" yaml:"labels,flow,omitempty"` // Labels used to search for groups of profiles DeviceResources []DeviceResource `json:"deviceResources" yaml:"deviceResources,omitempty"` Resources []ProfileResource `json:"resources" yaml:"resources,omitempty"` Commands []Command `json:"commands" yaml:"commands,omitempty"` // List of commands to Get/Put information for devices associated with this profile }
*This file is the model for a device profile in EdgeX * * * Device profile struct
func (DeviceProfile) MarshalJSON ¶
func (dp DeviceProfile) MarshalJSON() ([]byte, error)
Custom marshaling so that empty strings and arrays are null
func (DeviceProfile) String ¶
func (dp DeviceProfile) String() string
* To String function for DeviceProfile
type DeviceResource ¶
type DeviceResource struct { Description string `json:"description" yaml:"description,omitempty"` Name string `json:"name" yaml:"name,omitempty"` Tag string `json:"tag" yaml:"tag,omitempty"` Properties ProfileProperty `json:"properties" yaml:"properties"` Attributes map[string]interface{} `json:"attributes" yaml:"attributes,omitempty"` }
func (DeviceResource) MarshalJSON ¶
func (do DeviceResource) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (DeviceResource) String ¶
func (do DeviceResource) String() string
* To String function for DeviceResource
type DeviceService ¶
type DeviceService struct { Service AdminState AdminState `json:"adminState"` // Device Service Admin State }
func (DeviceService) MarshalJSON ¶
func (ds DeviceService) MarshalJSON() ([]byte, error)
Custom Marshaling to make empty strings null
func (DeviceService) String ¶
func (ds DeviceService) String() string
* To String function for DeviceService
func (*DeviceService) UnmarshalJSON ¶
func (ds *DeviceService) UnmarshalJSON(data []byte) error
Custom unmarshaling funcion
type EncryptionDetails ¶
type EncryptionDetails struct { Algo string `json:"encryptionAlgorithm,omitempty"` Key string `json:"encryptionKey,omitempty"` InitVector string `json:"initializingVector,omitempty"` }
EncryptionDetails - Provides details for encryption of export data per client request
type Event ¶
type Event struct { ID string `json:"id" codec:"omitempty"` Pushed int64 `json:"pushed" codec:"omitempty"` Device string `json:"device" codec:"omitempty"` // Device identifier (name or id) Created int64 `json:"created" codec:"omitempty"` Modified int64 `json:"modified" codec:"omitempty"` Origin int64 `json:"origin" codec:"omitempty"` Readings []Reading `json:"readings" codec:"omitempty"` // List of readings }
* This file is for the Event model in EdgeX * * * Event struct to hold event data
func (Event) MarshalJSON ¶
Custom marshaling to make empty strings null
type Filter ¶
type Filter struct { DeviceIDs []string `json:"deviceIdentifiers,omitempty"` ValueDescriptorIDs []string `json:"valueDescriptorIdentifiers,omitempty"` }
Filter - Specifies the client filters on reading data
type Get ¶
type Get struct {
Action `yaml:",inline"`
}
func (Get) MarshalJSON ¶
Custom marshaling to make empty strings and arrays null
type Interval ¶
type Interval struct { ID string `json:"id"` Created int64 `json:"created"` Modified int64 `json:"modified"` Origin int64 `json:"origin"` // not currently used reserved for interval origin source Name string `json:"name"` // non-database identifier for a shcedule (*must be quitue) Start string `json:"start"` // Start time i ISO 8601 format YYYYMMDD'T'HHmmss @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyymmdd'T'HHmmss") End string `json:"end"` // Start time i ISO 8601 format YYYYMMDD'T'HHmmss @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyymmdd'T'HHmmss") Frequency string `json:"frequency"` // how frequently should the event occur according ISO 8601 Cron string `json:"cron"` // cron styled regular expression indicating how often the action under interval should occur. Use either runOnce, frequency or cron and not all. RunOnce bool `json:"runOnce"` // boolean indicating that this interval runs one time - at the time indicated by the start }
Interval a period of time
func (Interval) MarshalJSON ¶
Custom marshaling to make empty strings null
type IntervalAction ¶
type IntervalAction struct { ID string `json:"id"` Created int64 `json:"created"` Modified int64 `json:"modified"` Origin int64 `json:"origin"` Name string `json:"name"` Interval string `json:"interval"` Parameters string `json:"parameters"` Target string `json:"target"` Protocol string `json:"protocol"` HTTPMethod string `json:"httpMethod"` Address string `json:"address"` Port int `json:"port"` Path string `json:"path"` Publisher string `json:"publisher"` User string `json:"user"` Password string `json:"password"` Topic string `json:"topic"` }
func (IntervalAction) GetBaseURL ¶
func (ia IntervalAction) GetBaseURL() string
func (IntervalAction) MarshalJSON ¶
func (ia IntervalAction) MarshalJSON() ([]byte, error)
func (IntervalAction) String ¶
func (ia IntervalAction) String() string
type LogEntry ¶
type LogEntry struct { Level string `bson:"logLevel" json:"logLevel"` Args []interface{} `bson:"args" json:"args"` OriginService string `bson:"originService" json:"originService"` Message string `bson:"message" json:"message"` Created int64 `bson:"created" json:"created"` }
func (LogEntry) MarshalJSON ¶
type Notification ¶
type Notification struct { BaseObject ID string `json:"id,omitempty"` Slug string `json:"slug,omitempty"` Sender string `json:"sender,omitempty"` Category NotificationsCategory `json:"category,omitempty"` Severity NotificationsSeverity `json:"severity,omitempty"` Content string `json:"content,omitempty"` Description string `json:"description,omitempty"` Status NotificationsStatus `json:"status,omitempty"` Labels []string `json:"labels,omitempty"` ContentType string `json:"contenttype,omitempty"` }
func (Notification) MarshalJSON ¶
func (n Notification) MarshalJSON() ([]byte, error)
func (Notification) String ¶
func (n Notification) String() string
* To String function for Notification Struct
type NotificationsCategory ¶
type NotificationsCategory string
func (*NotificationsCategory) UnmarshalJSON ¶
func (as *NotificationsCategory) UnmarshalJSON(data []byte) error
type NotificationsSeverity ¶
type NotificationsSeverity string
func (*NotificationsSeverity) UnmarshalJSON ¶
func (as *NotificationsSeverity) UnmarshalJSON(data []byte) error
type NotificationsStatus ¶
type NotificationsStatus string
func (*NotificationsStatus) UnmarshalJSON ¶
func (as *NotificationsStatus) UnmarshalJSON(data []byte) error
type NotifyUpdate ¶
type OperatingState ¶
type OperatingState string
OperatingState Constant String
func GetOperatingState ¶
func GetOperatingState(os string) (OperatingState, bool)
func (*OperatingState) UnmarshalJSON ¶
func (os *OperatingState) UnmarshalJSON(data []byte) error
UnmarshalJSON : Struct into json
type Operation ¶
type Operation struct { Action string `bson:"action" json:"action,omitempty"` Services []string `bson:"services,omitempty" json:"services,omitempty"` }
* An Operation for SMA processing. * * * Operation struct
func (*Operation) UnmarshalJSON ¶
Implements unmarshaling of JSON string to Operation type instance
type ProfileProperty ¶
type ProfileProperty struct { Value PropertyValue `json:"value"` Units Units `json:"units" yaml:"units,omitempty"` MediaType string `json:"mediaType" yaml:"mediaType,omitempty"` }
func (ProfileProperty) MarshalJSON ¶
func (p ProfileProperty) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (ProfileProperty) String ¶
func (pp ProfileProperty) String() string
* To String function for DeviceService
type ProfileResource ¶
type ProfileResource struct { Name string `json:"name" yaml:"name,omitempty"` Get []ResourceOperation `json:"get" yaml:"get,omitempty"` Set []ResourceOperation `json:"set" yaml:"set,omitempty"` }
func (ProfileResource) MarshalJSON ¶
func (pr ProfileResource) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (ProfileResource) String ¶
func (pr ProfileResource) String() string
* To String function for Profile Resource
type PropertyValue ¶
type PropertyValue struct { Type string `json:"type" yaml:"type,omitempty"` // ValueDescriptor Type of property after transformations ReadWrite string `json:"readWrite" yaml:"readWrite,omitempty"` // Read/Write Permissions set for this property Minimum string `json:"minimum" yaml:"minimum,omitempty"` // Minimum value that can be get/set from this property Maximum string `json:"maximum" yaml:"maximum,omitempty"` // Maximum value that can be get/set from this property DefaultValue string `json:"defaultValue" yaml:"defaultValue,omitempty"` // Default value set to this property if no argument is passed Size string `json:"size" yaml:"size,omitempty"` // Size of this property in its type (i.e. bytes for numeric types, characters for string types) Mask string `json:"mask" yaml:"mask,omitempty"` // Mask to be applied prior to get/set of property Shift string `json:"shift" yaml:"shift,omitempty"` // Shift to be applied after masking, prior to get/set of property Scale string `json:"scale" yaml:"scale,omitempty"` // Multiplicative factor to be applied after shifting, prior to get/set of property Offset string `json:"offset" yaml:"offset,omitempty"` // Additive factor to be applied after multiplying, prior to get/set of property Base string `json:"base" yaml:"base,omitempty"` // Base for property to be applied to, leave 0 for no power operation (i.e. base ^ property: 2 ^ 10) Assertion string `json:"assertion" yaml:"assertion,omitempty"` // Required value of the property, set for checking error state. Failing an assertion condition will mark the device with an error state Precision string `json:"precision" yaml:"precision,omitempty"` FloatEncoding string `json:"floatEncoding" yaml:"floatEncoding,omitempty"` // FloatEncoding indicates the representation of floating value of reading. It should be 'Base64' or 'eNotation' }
func (PropertyValue) MarshalJSON ¶
func (pv PropertyValue) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (PropertyValue) String ¶
func (pv PropertyValue) String() string
* To String function for DeviceService
type ProtocolProperties ¶
ProtocolProperties contains the device connection information in key/value pair
type ProvisionWatcher ¶
type ProvisionWatcher struct { BaseObject Id string `json:"id"` Name string `json:"name"` // unique name and identifier of the addressable Identifiers map[string]string `json:"identifiers"` // set of key value pairs that identify type of of address (MAC, HTTP,...) and address to watch for (00-05-1B-A1-99-99, 10.0.0.1,...) Profile DeviceProfile `json:"profile"` // device profile that should be applied to the devices available at the identifier addresses Service DeviceService `json:"service"` // device service that owns the watcher OperatingState OperatingState `json:"operatingState"` // operational state - either enabled or disabled }
func (ProvisionWatcher) MarshalJSON ¶
func (pw ProvisionWatcher) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (ProvisionWatcher) String ¶
func (pw ProvisionWatcher) String() string
* To String function for ProvisionWatcher
type Put ¶
type Put struct { Action `yaml:",inline"` ParameterNames []string `json:"parameterNames" yaml:"parameterNames,omitempty"` }
* This file is the model for Put commands in EdgeX * * Put Struct
func (Put) MarshalJSON ¶
Custom marshaling to make empty strings null
type Reading ¶
type Reading struct { Id string `json:"id"` Pushed int64 `json:"pushed"` // When the data was pushed out of EdgeX (0 - not pushed yet) Created int64 `json:"created"` // When the reading was created Origin int64 `json:"origin"` Modified int64 `json:"modified"` Device string `json:"device"` Name string `json:"name"` Value string `json:"value"` // Device sensor data value BinaryValue []byte `json:"binaryValue"` // Binary data payload AvgValue string `json:"avgValue"` // Device calculated average value MinValue string `json:"minValue"` // Device minimum sensor data value MaxValue string `json:"maxValue"` // Device maximum sensor data value }
* This file is for the Reading model in EdgeX * Holds data that was gathered from a device * * * Struct for the Reading object in EdgeX
func (Reading) MarshalJSON ¶
Custom marshaling to make empty strings null
type Registration ¶
type Registration struct { ID string `json:"id"` Created int64 `json:"created"` Modified int64 `json:"modified"` Origin int64 `json:"origin"` Name string `json:"name"` Addressable Addressable `json:"addressable"` Format string `json:"format"` Filter Filter `json:"filter"` Encryption EncryptionDetails `json:"encryption"` Compression string `json:"compression"` Enable bool `json:"enable"` Destination string `json:"destination"` }
Registration - Defines the registration details on the part of north side export clients
func (Registration) MarshalJSON ¶
func (reg Registration) MarshalJSON() ([]byte, error)
Custom marshaling for JSON Treat the strings as pointers so they can be null in JSON
func (Registration) Validate ¶
func (reg Registration) Validate() (bool, error)
type ResourceOperation ¶
type ResourceOperation struct { Index string `json:"index" yaml:"index,omitempty"` Operation string `json:"operation" yaml:"operation,omitempty"` Object string `json:"object" yaml:"object,omitempty"` Parameter string `json:"parameter" yaml:"parameter,omitempty"` Resource string `json:"resource" yaml:"resource,omitempty"` Secondary []string `json:"secondary" yaml:"secondary,omitempty"` Mappings map[string]string `json:"mappings" yaml:"mappings,omitempty"` }
func (ResourceOperation) MarshalJSON ¶
func (ro ResourceOperation) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (ResourceOperation) String ¶
func (ro ResourceOperation) String() string
* To String function for ResourceOperation
type Response ¶
type Response struct { Code string `json:"code" yaml:"code,omitempty"` Description string `json:"description" yaml:"description,omitempty"` ExpectedValues []string `json:"expectedValues" yaml:"expectedValues,omitempty"` }
* Response for a Get or Put request to a service * * * Response Struct
func (Response) MarshalJSON ¶
Custom marshalling to make empty strings null
type Service ¶
type Service struct { DescribedObject Id string `json:"id"` Name string `json:"name"` // time in milliseconds that the device last provided any feedback or responded to any request LastConnected int64 `json:"lastConnected"` // time in milliseconds that the device last reported data to the core LastReported int64 `json:"lastReported"` // operational state - either enabled or disabled OperatingState OperatingState `json:"operatingState"` // operational state - ether enabled or disableddc Labels []string `json:"labels"` // tags or other labels applied to the device service for search or other identification needs Addressable Addressable `json:"addressable"` // address (MQTT topic, HTTP address, serial bus, etc.) for reaching the service }
func (Service) MarshalJSON ¶
Custom Marshaling to make empty strings null
type Subscription ¶
type Subscription struct { BaseObject ID string `json:"id"` Slug string `json:"slug,omitempty"` Receiver string `json:"receiver,omitempty"` Description string `json:"description,omitempty"` SubscribedCategories []NotificationsCategory `json:"subscribedCategories,omitempty"` SubscribedLabels []string `json:"subscribedLabels,omitempty"` Channels []Channel `json:"channels,omitempty"` }
* A subscription for notification alerts * * * Subscription struct
func (Subscription) MarshalJSON ¶
func (s Subscription) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (Subscription) String ¶
func (s Subscription) String() string
* To String function for Notification Struct
type Transmission ¶
type Transmission struct { BaseObject ID string `json:"id"` Notification Notification `json:"notification"` Receiver string `json:"receiver,omitempty"` Channel Channel `json:"channel,omitempty"` Status TransmissionStatus `json:"status,omitempty"` ResendCount int `json:"resendcount"` Records []TransmissionRecord `json:"records,omitempty"` }
func (Transmission) MarshalJSON ¶
func (t Transmission) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (Transmission) String ¶
func (t Transmission) String() string
* To String function for Transmission Struct
type TransmissionRecord ¶
type TransmissionRecord struct { Status TransmissionStatus `json:"status"` Response string `json:"response"` Sent int64 `json:"sent"` }
func (TransmissionRecord) MarshalJSON ¶
func (t TransmissionRecord) MarshalJSON() ([]byte, error)
Custom marshaling to make empty strings null
func (TransmissionRecord) String ¶
func (t TransmissionRecord) String() string
* To String function for TransmissionRecord Struct
type TransmissionStatus ¶
type TransmissionStatus string
func (*TransmissionStatus) UnmarshalJSON ¶
func (as *TransmissionStatus) UnmarshalJSON(data []byte) error
* Unmarshal the enum type
Source Files ¶
- action.go
- actiontype.go
- addressable.go
- adminstate.go
- autoevent.go
- baseobject.go
- callbackalert.go
- category.go
- channel.go
- channel_type.go
- command.go
- commandresponse.go
- describedobject.go
- device.go
- deviceprofile.go
- deviceresource.go
- deviceservice.go
- encryptiondetails.go
- event.go
- filter.go
- get.go
- interval.go
- interval_action.go
- log_entry.go
- notifications.go
- notify_update.go
- operatingstate.go
- profileproperty.go
- profileresource.go
- propertyvalue.go
- provisionwatcher.go
- put.go
- reading.go
- registration.go
- resourceoperation.go
- response.go
- service.go
- severity.go
- sma_operation.go
- status.go
- subscription.go
- transmission.go
- transmission_record.go
- transmission_status.go
- units.go