models

package
v2.0.0-dev.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Locked : device is locked
	// Unlocked : device is unlocked
	Locked   = "LOCKED"
	Unlocked = "UNLOCKED"
)
View Source
const (
	Up      = "UP"
	Down    = "DOWN"
	Unknown = "UNKNOWN"
)

Up : UP Down : DOWN Unknown : UNKNOWN

View Source
const (
	// Base64Encoding : the float value is represented in Base64 encoding
	Base64Encoding = "Base64"
	// ENotation : the float value is represented in eNotation
	ENotation = "eNotation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminState

type AdminState string

AdminState controls the range of values which constitute valid administrative states for a device

type AutoEvent

type AutoEvent struct {
	Frequency string
	OnChange  bool
	Resource  string
}

AutoEvent and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/AutoEvent Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type BaseReading

type BaseReading struct {
	Id           string
	Created      int64
	Origin       int64
	DeviceName   string
	ResourceName string
	ProfileName  string
	ValueType    string
}

BaseReading and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BaseReading Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type BinaryReading

type BinaryReading struct {
	BaseReading `json:",inline"`
	BinaryValue []byte
	MediaType   string
}

BinaryReading and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BinaryReading Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

func (BinaryReading) GetBaseReading

func (b BinaryReading) GetBaseReading() BaseReading

Implement GetBaseReading() method in order for BinaryReading and SimpleReading structs to implement the abstract Reading interface and then be used as a Reading. Also, the Reading interface can access the BaseReading fields. This is Golang's way to implement inheritance.

type Command

type Command struct {
	Name string
	Get  bool
	Put  bool
}

Command and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/Command Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type Device

type Device struct {
	Timestamps
	Id             string
	Name           string
	Description    string
	AdminState     AdminState
	OperatingState OperatingState
	Protocols      map[string]ProtocolProperties
	LastConnected  int64
	LastReported   int64
	Labels         []string
	Location       interface{}
	ServiceName    string
	ProfileName    string
	AutoEvents     []AutoEvent
	Notify         bool
}

Device and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/Device Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type DeviceProfile

type DeviceProfile struct {
	Timestamps
	Description     string
	Id              string
	Name            string
	Manufacturer    string
	Model           string
	Labels          []string
	DeviceResources []DeviceResource
	DeviceCommands  []ProfileResource
	CoreCommands    []Command
}

DeviceProfile and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceProfile Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type DeviceResource

type DeviceResource struct {
	Description string
	Name        string
	Tag         string
	Properties  PropertyValue
	Attributes  map[string]string
}

DeviceResource and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceResource Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type DeviceService

type DeviceService struct {
	Timestamps
	Id            string
	Name          string
	Description   string
	LastConnected int64
	LastReported  int64
	Labels        []string
	BaseAddress   string
	AdminState    AdminState
}

DeviceService and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/DeviceService Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type Event

type Event struct {
	Id          string
	DeviceName  string
	ProfileName string
	Created     int64
	Origin      int64
	Readings    []Reading
	Tags        map[string]string
}

Event and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/Event Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type OperatingState

type OperatingState string

OperatingState Constant String

type ProfileResource

type ProfileResource struct {
	Name string
	Get  []ResourceOperation
	Set  []ResourceOperation
}

ProfileResource and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/ProfileResource Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type PropertyValue

type PropertyValue struct {
	Type         string
	ReadWrite    string
	Units        string
	Minimum      string
	Maximum      string
	DefaultValue string
	Mask         string
	Shift        string
	Scale        string
	Offset       string
	Base         string
	Assertion    string
	MediaType    string
}

PropertyValue and its properties care defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/PropertyValue Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type ProtocolProperties

type ProtocolProperties map[string]string

ProtocolProperties contains the device connection information in key/value pair

type ProvisionWatcher

type ProvisionWatcher struct {
	Timestamps
	Id                  string
	Name                string
	Labels              []string
	Identifiers         map[string]string
	BlockingIdentifiers map[string][]string
	ProfileName         string
	ServiceName         string
	AdminState          AdminState
	AutoEvents          []AutoEvent
}

ProvisionWatcher and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/ProvisionWatcher Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type Reading

type Reading interface {
	GetBaseReading() BaseReading
}

Reading is an abstract interface to be implemented by BinaryReading/SimpleReading

type ResourceOperation

type ResourceOperation struct {
	DeviceResource string
	Parameter      string
	Mappings       map[string]string
}

ResourceOperation and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.x#/ResourceOperation Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

type SimpleReading

type SimpleReading struct {
	BaseReading `json:",inline"`
	Value       string
}

SimpleReading and its properties are defined in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/SimpleReading Model fields are same as the DTOs documented by this swagger. Exceptions, if any, are noted below.

func (SimpleReading) GetBaseReading

func (s SimpleReading) GetBaseReading() BaseReading

type Timestamps

type Timestamps struct {
	Created  int64 // Created is a timestamp indicating when the entity was created.
	Modified int64 // Modified is a timestamp indicating when the entity was last modified.
}

Jump to

Keyboard shortcuts

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