Documentation
¶
Index ¶
- Variables
- func Add(spec CycleSpec) error
- func AddSubscriptor(id string, subscriptor transport.Subscriptor) error
- func Define(spec CycleSpec) (string, error)
- func DefineSubscriptor(id string, subscriptor transport.Subscriptor) (string, error)
- func GetCycles() map[string]CycleSpec
- func GetDevices() map[string]Device
- func GetSubscriptor(id string, subID string) (transport.Subscriptor, error)
- func GetSubscriptors(id string) (map[string]transport.Subscriptor, error)
- func GetSubscriptorsIds(id string) ([]string, error)
- func HasEnabledReports() bool
- func Undefine(id string) error
- func UndefineSubscriptor(id string, subID string) error
- func Update(spec CycleSpec) error
- func UpdateSubscriptor(id string, subID string, spec transport.Subscriptor) error
- type AdapterReport
- type CaptureData
- type CommonCycle
- type CycleConfiguration
- type CycleSpec
- type Device
- type DeviceReport
- type Field
- type FieldReport
- type Initiation
- type State
- type Termination
Constants ¶
This section is empty.
Variables ¶
View Source
var Pub pubsub
Functions ¶
func AddSubscriptor ¶
func AddSubscriptor(id string, subscriptor transport.Subscriptor) error
func DefineSubscriptor ¶
func DefineSubscriptor(id string, subscriptor transport.Subscriptor) (string, error)
func GetDevices ¶
func GetSubscriptor ¶
func GetSubscriptor(id string, subID string) (transport.Subscriptor, error)
func GetSubscriptors ¶
func GetSubscriptors(id string) (map[string]transport.Subscriptor, error)
func GetSubscriptorsIds ¶
func HasEnabledReports ¶
func HasEnabledReports() bool
func UndefineSubscriptor ¶
func UpdateSubscriptor ¶
func UpdateSubscriptor(id string, subID string, spec transport.Subscriptor) error
Types ¶
type AdapterReport ¶
type AdapterReport struct {
ApplicationID string `json:"applicationId,omitempty"`
ReportName string `json:"reportName,omitempty"`
Date time.Time `json:"date,omitempty"`
TotalMilliseconds int64 `json:"totalMilliseconds,omitempty"`
Initiation Initiation `json:"initiation,omitempty"`
Initiator string `json:"initiator,omitempty"`
Termination Termination `json:"termination,omitempty"`
Terminator string `json:"terminator,omitempty"`
Devices []*DeviceReport `json:"devices,omitempty"`
}
type CaptureData ¶
type CommonCycle ¶
type CommonCycle struct {
// contains filtered or unexported fields
}
type CycleConfiguration ¶
type CycleConfiguration struct {
Devices map[string]Device `json:"devices"`
Cycles map[string]CycleSpec `json:"cycles"`
Subscriptors map[string]map[string]transport.Subscriptor `json:"subscriptors"`
// contains filtered or unexported fields
}
func GetConfig ¶
func GetConfig() *CycleConfiguration
func (*CycleConfiguration) AddDevice ¶
func (c *CycleConfiguration) AddDevice(dev Device) (string, error)
func (*CycleConfiguration) GetDevice ¶
func (c *CycleConfiguration) GetDevice(id string) (Device, error)
func (*CycleConfiguration) SetDevice ¶
func (c *CycleConfiguration) SetDevice(dev Device) error
func (*CycleConfiguration) SetDeviceField ¶
func (c *CycleConfiguration) SetDeviceField(devId string, field Field) error
type CycleSpec ¶
type CycleSpec struct {
ID string `json:"id,omitempty"`
ApplicationID string `json:"applicationId,omitempty"`
Name string `json:"name,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Duration int64 `json:"duration"`
RepeatPeriod int64 `json:"repeatPeriod"`
Interval int `json:"interval,omitempty"`
WhenDataAvailable bool `json:"whenDataAvailable,omitempty"`
WhenDataAvailableDelay int `json:"WhenDataAvailableDelay,omitempty"`
ReportIfEmpty bool `json:"reportIfEmpty,omitempty"`
FieldSubscriptions map[string][]string `json:"fieldSubscriptions"`
}
type Device ¶
type Device struct {
ID string `json:"id"`
Name string `json:"name"`
Label string `json:"label"`
Enabled bool `json:"enabled,omitempty"`
Properties map[string]string `json:"properties,omitempty"`
Fields map[string]Field `json:"fields,omitempty"`
}
Device Adapter device
type DeviceReport ¶
type DeviceReport struct {
Name string `json:"name,omitempty"`
Fields []*FieldReport `json:"fields,omitempty"`
}
type Field ¶
type Field struct {
ID string `json:"id"`
Name string `json:"name"`
Label string `json:"label"`
Properties map[string]string `json:"properties,omitempty"`
Value interface{} `json:"value,omitempty"`
}
Field Device Field
type FieldReport ¶
type Initiation ¶
type Initiation string
const ( NULLINITIATION Initiation = "NULL" // UNDEFINE Cycle was undefined UNDEFINE Initiation = "UNDEFINE" // TRIGGER A trigger occurred TRIGGER Initiation = "TRIGGER" // REPEAT_PERIOD Repeat period expired REPEAT_PERIOD Initiation = "REPEAT_PERIOD" // REQUESTED State of cycle changed to requested REQUESTED Initiation = "REQUESTED" )
type Termination ¶
type Termination string
const ( NULLTERMINATION Termination = "NULL" //UNDEFINETERMINATION Cycle was undefined UNDEFINETERMINATION Termination = "UNDEFINE" //TRIGGERTERMINATION A trigger occurred TRIGGERTERMINATION Termination = "TRIGGER" //DURATION Duration period expired DURATION Termination = "DURATION" //INTERVAL Interval time expired INTERVAL Termination = "INTERVAL" //DATAAVAILABLE New data available DATAAVAILABLE Termination = "DATA_AVAILABLE" //UNREQUESTEDTERMINATION State of cycle changed to unrequested UNREQUESTEDTERMINATION Termination = "UNREQUESTED" //ERROR Error occurred ERROR Termination = "ERROR" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.