defaultmodule

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package defaultmodule provides a default implementation for decoding DIMO data.

Index

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

func (m *Module) EventConvert(_ context.Context, event cloudevent.RawEvent) ([]vss.Event, error)

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

func (m *Module) SignalConvert(_ context.Context, event cloudevent.RawEvent) ([]vss.Signal, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL