models

package
v0.1.111 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 0 Imported by: 44

Documentation

Index

Constants

View Source
const (
	// Locked : device is locked
	// Unlocked : device is unlocked
	Locked   = "LOCKED"
	Unlocked = "UNLOCKED"
)
View Source
const (
	Enabled  = "ENABLED"
	Disabled = "DISABLED"
)

Enabled : ENABLED Disabled : DISABLED

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 added in v0.1.67

type AdminState string

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

type AutoEvent added in v0.1.67

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
	Name       string
	Labels     []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 added in v0.1.68

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 added in v0.1.67

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 added in v0.1.67

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 added in v0.1.67

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 added in v0.1.67

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 added in v0.1.67

type DeviceService struct {
	Timestamps
	Id             string
	Name           string         // time in milliseconds that the device last provided any feedback or responded to any request
	Description    string         // Description of the device service
	LastConnected  int64          // time in milliseconds that the device last reported data to the core
	LastReported   int64          // operational state - either enabled or disabled
	OperatingState OperatingState // operational state - ether enabled or disableddc
	Labels         []string       // tags or other labels applied to the device service for search or other identification needs
	BaseAddress    string         // BaseAddress is a fully qualified URI, e.g. <protocol>:\\<hostname>:<port>/<optional path>
	AdminState     AdminState     // Device Service Admin State
}

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
	Pushed     int64
	DeviceName 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 added in v0.1.67

type OperatingState string

OperatingState Constant String

type ProfileResource added in v0.1.67

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 added in v0.1.67

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
	FloatEncoding 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 added in v0.1.67

type ProtocolProperties map[string]string

ProtocolProperties contains the device connection information in key/value pair

type Reading

type Reading interface {
	GetBaseReading() BaseReading
}

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

type ResourceOperation added in v0.1.67

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
	FloatEncoding 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 added in v0.1.68

func (s SimpleReading) GetBaseReading() BaseReading

type Timestamps added in v0.1.67

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