model

package
v0.0.0-...-cb7d559 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ServiceAnnouncement
	ID        string      `json:"id" redis:"id"`
	Protocol  string      `json:"protocol" redis:"protocol"`
	DeviceID  string      `json:"deviceId" redis:"deviceId"`
	LastState interface{} `json:"lastState" redis:"-"` // used to store the last state of the channel
}

func (*Channel) GetServiceAnnouncement

func (c *Channel) GetServiceAnnouncement() *ServiceAnnouncement

type ConfigurationRequest

type ConfigurationRequest struct {
	Action string          `json:"action"`
	Data   json.RawMessage `json:"data"`
}

type Device

type Device struct {
	ServiceAnnouncement
	ID            string             `json:"id" redis:"id"`
	NaturalID     string             `json:"naturalId" redis:"naturalId"`
	NaturalIDType string             `json:"naturalIdType" redis:"naturalIdType"`
	Name          *string            `json:"name,omitempty" redis:"name"`
	ThingID       *string            `json:"thingId,omitempty" redis:"-"`
	Channels      *[]*Channel        `json:"channels,omitempty" redis:"-"`
	Signatures    *map[string]string `json:"signatures,omitempty" redis:"signatures,json"`
}

Device TODO: The channels and thing might want to be on a struct thats only used in the devicemodel service?

func (*Device) GetChannelsByProtocol

func (d *Device) GetChannelsByProtocol(protocol string) []*Channel

func (*Device) GetServiceAnnouncement

func (d *Device) GetServiceAnnouncement() *ServiceAnnouncement

type Module

type Module struct {
	ServiceAnnouncement
	ID          string `json:"id" redis:"id"`
	Name        string `json:"name" redis:"name"`
	Version     string `json:"version" redis:"version"`
	Description string `json:"description" redis:"description"`
	Author      string `json:"author" redis:"author"`
	License     string `json:"license" redis:"license"`
}

func (*Module) GetServiceAnnouncement

func (m *Module) GetServiceAnnouncement() *ServiceAnnouncement

type Room

type Room struct {
	Name string `json:"name" redis:"name"`
	ID   string `json:"id" redis:"id"`
	Type string `json:"type" redis:"type"`
}

type ServiceAnnouncement

type ServiceAnnouncement struct {
	Topic            string    `json:"topic" redis:"topic"`
	Schema           string    `json:"schema" redis:"schema"`
	SupportedMethods *[]string `json:"supportedMethods" redis:"supportedMethods,json"`
	SupportedEvents  *[]string `json:"supportedEvents" redis:"supportedEvents,json"`
}

type Site

type Site struct {
	ID              string      `json:"id,omitempty" redis:"id"`
	Name            *string     `json:"name,omitempty" redis:"name"`
	Type            *string     `json:"type,omitempty" redis:"type"`
	Latitude        *float64    `json:"latitude,omitempty" redis:"latitude"`
	Longitude       *float64    `json:"longitude,omitempty" redis:"longitude"`
	TimeZoneID      *string     `json:"timeZoneId,omitempty" redis:"timeZoneId"`
	TimeZoneName    *string     `json:"timeZoneName,omitempty" redis:"timeZoneName"`
	TimeZoneOffset  *int        `json:"timeZoneOffset,omitempty" redis:"timeZoneOffset"`
	SitePreferences interface{} `json:"site-preferences,omitempty" redis:"site-preferences,json"`
	DefaultRoomID   *string     `json:"defaultRoomId,omitempty" redis:"defaultRoomId,json"`
}

type Thing

type Thing struct {
	ID       string  `json:"id" redis:"id"`
	Type     string  `json:"type" redis:"type"`
	Name     string  `json:"name" redis:"name"`
	Device   *Device `json:"device,omitempty" redis:"-"`
	DeviceID *string `json:"deviceId,omitempty" redis:"-"`
	Location *string `json:"location,omitempty" redis:"location"`
	Promoted bool    `json:"promoted" redis:"promoted"`
}

type TimeSeriesDatapoint

type TimeSeriesDatapoint struct {
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
	Type  string      `json:"type"`
}

type TimeSeriesPayload

type TimeSeriesPayload struct {
	Thing        string                `json:"thing"`
	ThingType    string                `json:"thingType"`
	Promoted     bool                  `json:"promoted"`
	Device       string                `json:"device"`
	Channel      string                `json:"channel"`
	Schema       string                `json:"schema"`
	Event        string                `json:"event"`
	Points       []TimeSeriesDatapoint `json:"points"`
	Time         string                `json:"time"`
	TimeZone     string                `json:"timeZone"`
	TimeOffset   int                   `json:"timeOffset"`
	Site         string                `json:"site"`
	UserOverride string                `json:"_"`
	NodeOverride string                `json:"_"`
}

func (*TimeSeriesPayload) GetPath

func (p *TimeSeriesPayload) GetPath(path string) interface{}

func (*TimeSeriesPayload) GetTime

func (p *TimeSeriesPayload) GetTime() (time.Time, error)

Jump to

Keyboard shortcuts

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