Documentation
¶
Index ¶
- Constants
- type Adapter
- type App
- type AttributeValueContainer
- type Bridge
- type ID
- type Interface
- type InterfaceFlatView
- type Location
- type Service
- type ServiceExtendedView
- type Thing
- type ThingExtendedView
- type ThingRegistry
- type ThingRegistryStore
- func (st *ThingRegistryStore) ClearAll() error
- func (st *ThingRegistryStore) Connect() error
- func (st *ThingRegistryStore) DeleteLocation(id ID) error
- func (st *ThingRegistryStore) DeleteService(id ID) error
- func (st *ThingRegistryStore) DeleteThing(id ID) error
- func (st *ThingRegistryStore) Disconnect()
- func (st *ThingRegistryStore) ExtendThingsWithLocation(things []Thing) []ThingWithLocationView
- func (st *ThingRegistryStore) GetAllLocations() ([]Location, error)
- func (st *ThingRegistryStore) GetAllServices() ([]Service, error)
- func (st *ThingRegistryStore) GetAllThings() ([]Thing, error)
- func (st *ThingRegistryStore) GetConnection() interface{}
- func (st *ThingRegistryStore) GetExtendedServices(serviceNameFilter string, filterWithoutAlias bool, thingIdFilter ID, ...) ([]ServiceExtendedView, error)
- func (st *ThingRegistryStore) GetLocationById(Id ID) (*Location, error)
- func (st *ThingRegistryStore) GetLocationByIntegrationId(id string) (*Location, error)
- func (st *ThingRegistryStore) GetServiceByAddress(serviceName string, serviceAddress string) (*Service, error)
- func (st *ThingRegistryStore) GetServiceByFullAddress(address string) (*ServiceExtendedView, error)
- func (st *ThingRegistryStore) GetServiceById(Id ID) (*Service, error)
- func (st *ThingRegistryStore) GetState() string
- func (st *ThingRegistryStore) GetThingByAddress(technology string, address string) (*Thing, error)
- func (st *ThingRegistryStore) GetThingById(Id ID) (*Thing, error)
- func (st *ThingRegistryStore) GetThingByIntegrationId(id string) (*Thing, error)
- func (st *ThingRegistryStore) GetThingExtendedViewByAddress(technology string, address string) (*ThingExtendedView, error)
- func (st *ThingRegistryStore) GetThingExtendedViewById(Id ID) (*ThingExtendedView, error)
- func (st *ThingRegistryStore) GetThingsByLocationId(locationId ID) ([]Thing, error)
- func (st *ThingRegistryStore) Init() error
- func (st *ThingRegistryStore) LoadConfig(config interface{}) error
- func (st *ThingRegistryStore) ReindexAll() error
- func (st *ThingRegistryStore) Stop()
- func (st *ThingRegistryStore) UpsertLocation(location *Location) (ID, error)
- func (st *ThingRegistryStore) UpsertService(service *Service) (ID, error)
- func (st *ThingRegistryStore) UpsertThing(thing *Thing) (ID, error)
- type ThingWithLocationView
Constants ¶
View Source
const ( AppContainer = "app" ThingContainer = "thing" AttributeUpdatedByCmd = 1 AttributeUpdatedByEvt = 2 )
View Source
const IDnil = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeValueContainer ¶
type InterfaceFlatView ¶
type InterfaceFlatView struct {
ThingId ID `json:"thing_id"`
ThingAddress string `json:"thing_address"`
ThingTech string `json:"thing_tech"`
ThingAlias string `json:"thing_alias"`
ServiceId ID `json:"service_id"`
ServiceName string `json:"service_name"`
ServiceAlias string `json:"service_alias"`
ServiceAddress string `json:"service_address"`
InterfaceType string `json:"intf_type"`
InterfaceMsgType string `json:"intf_msg_type"`
InterfaceAddress string `json:"intf_address"`
InterfaceValueType string `json:"intf_val_type"`
LocationId ID `json:"location_id"`
LocationAlias string `json:"location_alias"`
LocationType string `json:"location_type"`
Groups []string `json:"groups"`
}
type Location ¶
type Location struct {
ID ID `json:"id" storm:"id,increment,index"`
IntegrationId string `json:"integr_id"`
Type string `json:"type"`
Alias string `json:"alias"`
Address string `json:"address"`
Longitude float64 `json:"long"`
Latitude float64 `json:"lat"`
Image string `json:"image"`
ChildLocations []Location `json:"child_locations"`
State string `json:"state"`
}
type Service ¶
type Service struct {
ID ID `json:"id" storm:"id,increment,index"`
IntegrationId string `json:"integr_id" storm:"index"`
ParentContainerId ID `json:"container_id" storm:"index"`
ParentContainerType string `json:"container_type" storm:"index"`
Name string `json:"name" storm:"index"`
Enabled bool `json:"enabled"`
Alias string `json:"alias"`
Address string `json:"address" storm:"index"`
Groups []string `json:"groups"`
LocationId ID `json:"location_id" storm:"index"`
Props map[string]interface{} `json:"props"`
Tags []string `json:"tags"`
Interfaces []Interface `json:"interfaces"`
Attributes map[string]AttributeValueContainer `json:"attributes"`
}
type ServiceExtendedView ¶
type Thing ¶
type Thing struct {
ID ID `json:"id" storm:"id,increment,index"`
IntegrationId string `json:"integr_id" storm:"index"`
Address string `json:"address" storm:"index"`
Type string `json:"type"`
ProductHash string `json:"product_hash"`
Alias string `json:"alias"`
CommTechnology string `json:"comm_tech" storm:"index"`
ProductId string `json:"product_id"`
ProductName string `json:"product_name"`
ManufacturerId string `json:"manufacturer_id"`
DeviceId string `json:"device_id"`
HwVersion string `json:"hw_ver"`
SwVersion string `json:"sw_ver"`
PowerSource string `json:"power_source"`
WakeUpInterval string `json:"wakeup_interval"`
Security string `json:"security"`
Tags []string `json:"tags"`
LocationId ID `json:"location_id" storm:"index"`
PropSets map[string]map[string]interface{} `json:"prop_set"`
TechSpecificProps map[string]string `json:"tech_specific_props"`
UpdatedAt time.Time `json:"updated_at"`
}
type ThingExtendedView ¶
type ThingExtendedView struct {
Thing
Services []ServiceExtendedView `json:"services"`
LocationAlias string `json:"location_alias"`
}
type ThingRegistry ¶
type ThingRegistryStore ¶
type ThingRegistryStore struct {
// contains filtered or unexported fields
}
func NewThingRegistryStore ¶
func NewThingRegistryStore(storeFile string) *ThingRegistryStore
func (*ThingRegistryStore) ClearAll ¶
func (st *ThingRegistryStore) ClearAll() error
func (*ThingRegistryStore) Connect ¶
func (st *ThingRegistryStore) Connect() error
func (*ThingRegistryStore) DeleteLocation ¶
func (st *ThingRegistryStore) DeleteLocation(id ID) error
func (*ThingRegistryStore) DeleteService ¶
func (st *ThingRegistryStore) DeleteService(id ID) error
func (*ThingRegistryStore) DeleteThing ¶
func (st *ThingRegistryStore) DeleteThing(id ID) error
func (*ThingRegistryStore) Disconnect ¶
func (st *ThingRegistryStore) Disconnect()
func (*ThingRegistryStore) ExtendThingsWithLocation ¶
func (st *ThingRegistryStore) ExtendThingsWithLocation(things []Thing) []ThingWithLocationView
func (*ThingRegistryStore) GetAllLocations ¶
func (st *ThingRegistryStore) GetAllLocations() ([]Location, error)
func (*ThingRegistryStore) GetAllServices ¶
func (st *ThingRegistryStore) GetAllServices() ([]Service, error)
func (*ThingRegistryStore) GetAllThings ¶
func (st *ThingRegistryStore) GetAllThings() ([]Thing, error)
func (*ThingRegistryStore) GetConnection ¶
func (st *ThingRegistryStore) GetConnection() interface{}
func (*ThingRegistryStore) GetExtendedServices ¶
func (st *ThingRegistryStore) GetExtendedServices(serviceNameFilter string, filterWithoutAlias bool, thingIdFilter ID, locationIdFilter ID) ([]ServiceExtendedView, error)
GetExtendedServices return services enhanced with location Alias
func (*ThingRegistryStore) GetLocationById ¶
func (st *ThingRegistryStore) GetLocationById(Id ID) (*Location, error)
func (*ThingRegistryStore) GetLocationByIntegrationId ¶
func (st *ThingRegistryStore) GetLocationByIntegrationId(id string) (*Location, error)
func (*ThingRegistryStore) GetServiceByAddress ¶
func (st *ThingRegistryStore) GetServiceByAddress(serviceName string, serviceAddress string) (*Service, error)
func (*ThingRegistryStore) GetServiceByFullAddress ¶
func (st *ThingRegistryStore) GetServiceByFullAddress(address string) (*ServiceExtendedView, error)
func (*ThingRegistryStore) GetServiceById ¶
func (st *ThingRegistryStore) GetServiceById(Id ID) (*Service, error)
func (*ThingRegistryStore) GetState ¶
func (st *ThingRegistryStore) GetState() string
func (*ThingRegistryStore) GetThingByAddress ¶
func (st *ThingRegistryStore) GetThingByAddress(technology string, address string) (*Thing, error)
func (*ThingRegistryStore) GetThingById ¶
func (st *ThingRegistryStore) GetThingById(Id ID) (*Thing, error)
func (*ThingRegistryStore) GetThingByIntegrationId ¶
func (st *ThingRegistryStore) GetThingByIntegrationId(id string) (*Thing, error)
func (*ThingRegistryStore) GetThingExtendedViewByAddress ¶
func (st *ThingRegistryStore) GetThingExtendedViewByAddress(technology string, address string) (*ThingExtendedView, error)
func (*ThingRegistryStore) GetThingExtendedViewById ¶
func (st *ThingRegistryStore) GetThingExtendedViewById(Id ID) (*ThingExtendedView, error)
GetThingExtendedViewById return thing enhanced with linked services and location Alias
func (*ThingRegistryStore) GetThingsByLocationId ¶
func (st *ThingRegistryStore) GetThingsByLocationId(locationId ID) ([]Thing, error)
func (*ThingRegistryStore) Init ¶
func (st *ThingRegistryStore) Init() error
func (*ThingRegistryStore) LoadConfig ¶
func (st *ThingRegistryStore) LoadConfig(config interface{}) error
func (*ThingRegistryStore) ReindexAll ¶
func (st *ThingRegistryStore) ReindexAll() error
func (*ThingRegistryStore) Stop ¶
func (st *ThingRegistryStore) Stop()
func (*ThingRegistryStore) UpsertLocation ¶
func (st *ThingRegistryStore) UpsertLocation(location *Location) (ID, error)
func (*ThingRegistryStore) UpsertService ¶
func (st *ThingRegistryStore) UpsertService(service *Service) (ID, error)
func (*ThingRegistryStore) UpsertThing ¶
func (st *ThingRegistryStore) UpsertThing(thing *Thing) (ID, error)
type ThingWithLocationView ¶
Click to show internal directories.
Click to hide internal directories.