models

package
v0.0.0-...-2dca463 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Locked : device is locked
	// Unlocked : device is unlocked
	Locked   = "LOCKED"
	Unlocked = "UNLOCKED"
)
View Source
const (
	TraceLog = "TRACE"
	DebugLog = "DEBUG"
	InfoLog  = "INFO"
	WarnLog  = "WARN"
	ErrorLog = "ERROR"
)

These constants identify the log levels in order of increasing severity.

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 `gorm:"id;primaryKey"`
	Created      int64
	EventId      string
	Origin       int64
	DeviceName   string
	ResourceName string
	ProfileName  string
	ValueType    string
	Value        string
	BinaryValue  []byte
	MediaType    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.

func (*BaseReading) Get

func (table *BaseReading) Get() interface{}

func (*BaseReading) TableName

func (table *BaseReading) TableName() string

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
	DisplayName    string
	Description    string
	AdminState     AdminState
	OperatingState OperatingState
	Protocols      map[string]ProtocolProperties
	LastConnected  int64
	LastReported   int64
	Labels         []string
	Location       interface{}
	ServiceName    string
	ProfileName    string
	ServiceId      string
	ProfileId      string
	AutoEvents     []AutoEvent
	Notify         bool
	ActiveStatus   string
	CloudDeviceId  string
}

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
	Id              string
	Name            string
	DisplayName     string
	Description     string
	Manufacturer    string
	Model           string
	Labels          []string
	DeviceResources []DeviceResource
	DeviceCommands  []ProfileResource
	CoreCommands    []Command
	DeviceLibraryId string
}

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
	ServiceName     string
	DeviceLibraryId string
}

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 {
	Timestamps
	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 LogEntry

type LogEntry struct {
	Level         string        `bson:"logLevel,omitempty" json:"logLevel"`
	Args          []interface{} `bson:"args,omitempty" json:"args"`
	OriginService string        `bson:"originService,omitempty" json:"originService"`
	Message       string        `bson:"message,omitempty" json:"message"`
	Created       int64         `bson:"created,omitempty" json:"created"`
	// contains filtered or unexported fields
}

func (*LogEntry) UnmarshalJSON

func (le *LogEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for the LogEntry type

func (LogEntry) Validate

func (le LogEntry) Validate() (bool, error)

Validate satisfies the Validator interface

type OperatingState

type OperatingState string

OperatingState Constant String

type ProfileProperty

type ProfileProperty struct {
	Value PropertyValue `json:"value"`
	Units Units         `json:"units"`
}

func (ProfileProperty) MarshalJSON

func (pp ProfileProperty) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface

func (ProfileProperty) String

func (pp ProfileProperty) String() string

String returns a JSON encoded string representation of this ProfileProperty

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 {
	DataType     int
	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.
}

type Units

type Units struct {
	Type         string `json:"type,omitempty" yaml:"type,omitempty"`
	ReadWrite    string `json:"readWrite,omitempty" yaml:"readWrite,omitempty"`
	DefaultValue string `json:"defaultValue,omitempty" yaml:"defaultValue,omitempty"`
}

func (Units) String

func (u Units) String() string

String returns a JSON encoded string representation of the model

type ValueDescriptor

type ValueDescriptor struct {
	Id            string      `json:"id,omitempty"`
	Created       int64       `json:"created,omitempty"`
	Description   string      `json:"description,omitempty"`
	Modified      int64       `json:"modified,omitempty"`
	Origin        int64       `json:"origin,omitempty"`
	Name          string      `json:"name,omitempty"`
	Min           interface{} `json:"min,omitempty"`
	Max           interface{} `json:"max,omitempty"`
	DefaultValue  interface{} `json:"defaultValue,omitempty"`
	Type          string      `json:"type,omitempty"`
	UomLabel      string      `json:"uomLabel,omitempty"`
	Formatting    string      `json:"formatting,omitempty"`
	Labels        []string    `json:"labels,omitempty"`
	MediaType     string      `json:"mediaType,omitempty"`
	FloatEncoding string      `json:"floatEncoding,omitempty"`
	// contains filtered or unexported fields
}

* Value Descriptor Struct

func From

From creates a ValueDescriptor based on the information provided in the DeviceResource.

func (ValueDescriptor) String

func (a ValueDescriptor) String() string

String returns a JSON encoded string representation of the model

func (*ValueDescriptor) UnmarshalJSON

func (v *ValueDescriptor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for the ValueDescriptor type

func (ValueDescriptor) Validate

func (v ValueDescriptor) Validate() (bool, error)

Validate satisfies the Validator interface

Jump to

Keyboard shortcuts

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