defaultmodule

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 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 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

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.
	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