Documentation ¶
Index ¶
- Variables
- func StartKafkaCacheInvalidator(ctx context.Context, config configuration.Config) (err error)
- type BatchRequest
- type BatchResultElement
- type Command
- func (this *Command) Batch(token auth.Token, batch BatchRequest, timeout string, preferEventValue bool) []BatchResultElement
- func (this *Command) Command(token auth.Token, cmd CommandMessage, timeout string, preferEventValue bool) (code int, resp interface{})
- func (this *Command) DeviceCommand(token auth.Token, deviceId string, serviceId string, functionId string, ...) (code int, resp interface{})
- func (this *Command) ErrorMessageHandler(message messages.ProtocolMsg) error
- func (this *Command) GetEventBatch(token auth.Token, tasks BatchRequest, preferEventValue bool) (batch *eventbatch.EventBatch, err error)
- func (this *Command) GetLastEventValue(token auth.Token, device model.Device, service model.Service, ...) (code int, result interface{})
- func (this *Command) GetMetricsHttpHandler() *metrics.Metrics
- func (this *Command) GetSubTasks(token string, deviceGroupId string, functionId string, aspectId string, ...) (result []SubCommand, err error)
- func (this *Command) GroupCommand(token auth.Token, groupId string, functionId string, aspectId string, ...) (code int, resp interface{})
- func (this *Command) HandleTaskResponse(message messages.ProtocolMsg) (err error)
- type CommandMessage
- type SubCommand
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingLastValue = errors.New("missing last value in mgw-last-value")
View Source
var ErrMissingLastValueCode = 513 //custom code to signify missing last-value in mgw-last-value
Functions ¶
func StartKafkaCacheInvalidator ¶ added in v1.0.3
func StartKafkaCacheInvalidator(ctx context.Context, config configuration.Config) (err error)
Types ¶
type BatchRequest ¶
type BatchRequest []CommandMessage
func (BatchRequest) Validate ¶
func (this BatchRequest) Validate() error
type BatchResultElement ¶
type BatchResultElement struct { StatusCode int `json:"status_code"` Message interface{} `json:"message"` }
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewWithFactories ¶
func NewWithFactories(ctx context.Context, config configuration.Config, comFactory interfaces.ComFactory, marshallerFactory interfaces.MarshallerFactory, iotFactory interfaces.IotFactory, timescaleFactory interfaces.TimescaleFactory) (cmd *Command, err error)
func (*Command) Batch ¶
func (this *Command) Batch(token auth.Token, batch BatchRequest, timeout string, preferEventValue bool) []BatchResultElement
func (*Command) DeviceCommand ¶
func (*Command) ErrorMessageHandler ¶
func (this *Command) ErrorMessageHandler(message messages.ProtocolMsg) error
func (*Command) GetEventBatch ¶
func (this *Command) GetEventBatch(token auth.Token, tasks BatchRequest, preferEventValue bool) (batch *eventbatch.EventBatch, err error)
func (*Command) GetLastEventValue ¶
func (*Command) GetMetricsHttpHandler ¶ added in v1.0.11
func (*Command) GetSubTasks ¶
func (*Command) GroupCommand ¶
func (*Command) HandleTaskResponse ¶
func (this *Command) HandleTaskResponse(message messages.ProtocolMsg) (err error)
type CommandMessage ¶
type CommandMessage struct { FunctionId string `json:"function_id"` //mandatory AspectId string `json:"aspect_id,omitempty"` //optional Input interface{} `json:"input"` //device command DeviceId string `json:"device_id,omitempty"` ServiceId string `json:"service_id,omitempty"` //group command GroupId string `json:"group_id,omitempty"` DeviceClassId string `json:"device_class_id,omitempty"` CharacteristicId string `json:"characteristic_id,omitempty"` }
func (CommandMessage) Hash ¶
func (this CommandMessage) Hash() string
func (CommandMessage) Validate ¶
func (this CommandMessage) Validate() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.