types

package
v0.0.0-...-a398a49 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviceStateUnknown = -1
	DeviceStateOK      = 1
	DeviceStateWarning = 2
	DeviceStateError   = 3
)
View Source
const (
	AlarmSeverityLow    = 1
	AlarmSeverityMedium = 2
	AlarmSeverityHigh   = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	ID          string    `json:"id"`
	AlarmType   string    `json:"alarmType"`
	Description string    `json:"description,omitempty"`
	ObservedAt  time.Time `json:"observedAt"`
	RefID       string    `json:"refID"`
	Severity    int       `json:"severity"`
	Tenant      string    `json:"tenant"`
}

type Bounds

type Bounds struct {
	MinLon float64
	MaxLon float64
	MinLat float64
	MaxLat float64
}

type Collection

type Collection[T any] struct {
	Data       []T
	Count      uint64
	Offset     uint64
	Limit      uint64
	TotalCount uint64
}

type Device

type Device struct {
	Active      bool     `json:"active"`
	SensorID    string   `json:"sensorID"`
	DeviceID    string   `json:"deviceID"`
	Tenant      string   `json:"tenant"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Location    Location `json:"location"`
	Environment string   `json:"environment,omitempty"`
	Source      string   `json:"source,omitempty"`

	Lwm2mTypes []Lwm2mType `json:"types"`
	Tags       []Tag       `json:"tags,omitempty"`

	DeviceProfile DeviceProfile `json:"deviceProfile"`

	DeviceStatus DeviceStatus `json:"deviceStatus"`
	DeviceState  DeviceState  `json:"deviceState"`

	Alarms []string `json:"alarms,omitempty"`
}

type DeviceCreated

type DeviceCreated struct {
	DeviceID  string    `json:"deviceID"`
	Tenant    string    `json:"tenant,omitempty"`
	Timestamp time.Time `json:"timestamp"`
}

func (DeviceCreated) Body

func (d DeviceCreated) Body() []byte

func (*DeviceCreated) ContentType

func (d *DeviceCreated) ContentType() string

func (*DeviceCreated) TopicName

func (d *DeviceCreated) TopicName() string

type DeviceProfile

type DeviceProfile struct {
	Name     string   `json:"name" yaml:"name"`
	Decoder  string   `json:"decoder" yaml:"decoder"`
	Interval int      `json:"interval" yaml:"interval"`
	Types    []string `json:"types,omitempty" yaml:"types"`
}

type DeviceState

type DeviceState struct {
	Online     bool      `json:"online"`
	State      int       `json:"state"`
	ObservedAt time.Time `json:"observedAt"`
}

type DeviceStateUpdated

type DeviceStateUpdated struct {
	DeviceID  string    `json:"deviceID"`
	State     int       `json:"state"`
	Tenant    string    `json:"tenant,omitempty"`
	Timestamp time.Time `json:"timestamp"`
}

func (DeviceStateUpdated) Body

func (d DeviceStateUpdated) Body() []byte

func (*DeviceStateUpdated) ContentType

func (d *DeviceStateUpdated) ContentType() string

func (*DeviceStateUpdated) TopicName

func (d *DeviceStateUpdated) TopicName() string

type DeviceStatus

type DeviceStatus struct {
	BatteryLevel int       `json:"batteryLevel"`
	ObservedAt   time.Time `json:"observedAt"`
}

type DeviceStatusUpdated

type DeviceStatusUpdated struct {
	DeviceID     string       `json:"deviceID"`
	DeviceStatus DeviceStatus `json:"status"`
	Tenant       string       `json:"tenant,omitempty"`
	Timestamp    time.Time    `json:"timestamp"`
}

func (DeviceStatusUpdated) Body

func (d DeviceStatusUpdated) Body() []byte

func (*DeviceStatusUpdated) ContentType

func (d *DeviceStatusUpdated) ContentType() string

func (*DeviceStatusUpdated) TopicName

func (d *DeviceStatusUpdated) TopicName() string

type DeviceUpdated

type DeviceUpdated struct {
	DeviceID  string    `json:"deviceID"`
	Tenant    string    `json:"tenant,omitempty"`
	Timestamp time.Time `json:"timestamp"`
}

func (DeviceUpdated) Body

func (d DeviceUpdated) Body() []byte

func (DeviceUpdated) ContentType

func (d DeviceUpdated) ContentType() string

func (DeviceUpdated) TopicName

func (d DeviceUpdated) TopicName() string

type InformationItem

type InformationItem struct {
	DeviceID   string    `json:"deviceID"`
	ObservedAt time.Time `json:"observedAt"`
	Types      []string  `json:"types"`
}

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Lwm2mType

type Lwm2mType struct {
	Urn  string `json:"urn" yaml:"urn"`
	Name string `json:"name" yaml:"name"`
}

type Tag

type Tag struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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