Documentation
¶
Overview ¶
Package defaultmodule provides a default implementation for decoding DIMO data.
Index ¶
- func LoadSignalAndEventTagMap() (map[string]*schema.SignalInfo, map[string]*schema.EventTagInfo, error)
- func SignalConvert(event cloudevent.RawEvent, signalMap map[string]*schema.SignalInfo) ([]vss.Signal, error)
- type Event
- type EventsData
- type Module
- func (*Module) CloudEventConvert(_ context.Context, msgData []byte) ([]cloudevent.CloudEventHeader, []byte, error)
- func (m *Module) EventConvert(_ context.Context, event cloudevent.RawEvent) ([]vss.Event, 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 LoadSignalAndEventTagMap ¶ added in v0.7.3
func LoadSignalAndEventTagMap() (map[string]*schema.SignalInfo, map[string]*schema.EventTagInfo, 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 Event ¶ added in v0.6.3
type Event struct {
// Name is the name of the event.
Name string `json:"name"`
// Timestamp is when this event occurred. (format: RFC3339)
Timestamp time.Time `json:"timestamp"`
// Duration is the duration of the event in nanoseconds.
DurationNs uint64 `json:"durationNs,omitempty"`
// Metadata is the metadata of the event.
Metadata string `json:"metadata,omitempty"`
// Tags is a list of tags for the event.
Tags []string `json:"tags"`
}
Event is a struct for holding a single event.
type EventsData ¶ added in v0.6.3
type EventsData struct {
Events []Event `json:"events"`
}
EventsData is a struct for holding a list of events.
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) EventConvert ¶ added in v0.6.3
EventConvert converts a default CloudEvent to events.
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. (format: RFC3339)
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.