Documentation
¶
Overview ¶
Package defaultmodule provides a default implementation for decoding DIMO data.
Index ¶
- func LoadSignalMap() (map[string]*schema.SignalInfo, error)
- func SignalConvert(event cloudevent.RawEvent, signalMap map[string]*schema.SignalInfo) ([]vss.Signal, error)
- type Module
- func (*Module) CloudEventConvert(_ context.Context, msgData []byte) ([]cloudevent.CloudEventHeader, []byte, error)
- func (*Module) FingerprintConvert(_ context.Context, event cloudevent.RawEvent) (cloudevent.Fingerprint, error)
- func (m *Module) SignalConvert(_ context.Context, event cloudevent.RawEvent) ([]vss.Signal, error)
- type Signal
- type SignalData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadSignalMap ¶
func LoadSignalMap() (map[string]*schema.SignalInfo, error)
LoadSignalMap loads the default signal map.
func SignalConvert ¶
func SignalConvert(event cloudevent.RawEvent, signalMap map[string]*schema.SignalInfo) ([]vss.Signal, error)
SignalConvert converts a default CloudEvent to DIMO's vss signals.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module holds dependencies for the default module. At present, there are none.
func (*Module) CloudEventConvert ¶
func (*Module) CloudEventConvert(_ context.Context, msgData []byte) ([]cloudevent.CloudEventHeader, []byte, error)
CloudEventConvert marshals the input message to Cloud Events and sets the type based on the message content.
func (*Module) FingerprintConvert ¶
func (*Module) FingerprintConvert(_ context.Context, event cloudevent.RawEvent) (cloudevent.Fingerprint, error)
FingerprintConvert converts a default CloudEvent to a FingerprintEvent.
func (*Module) SignalConvert ¶
SignalConvert converts a default CloudEvent to DIMO's vss signals.
type Signal ¶
type Signal struct {
// Timestamp is when this data was collected.
Timestamp time.Time `json:"timestamp"`
// Name is the name of the signal collected.
Name string `json:"name"`
// Value is the value of the signal collected. If the signal base type is a number it will be converted to a float64.
Value any `json:"value"`
}
Signal is a struct for holding vss signal data.
type SignalData ¶
type SignalData struct {
Signals []*Signal `json:"signals"`
}
SignalData is a struct for holding vss signal data.
Click to show internal directories.
Click to hide internal directories.