events

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: BSD-3-Clause-Clear Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEventsTable

func CreateEventsTable(dbFilePath string) error

func DeleteEvents

func DeleteEvents(dbFilePath string, maxId int) error

func FlushEvents

func FlushEvents(dbFilePath string, client *client.GatewayClient) error

func SaveEvent

func SaveEvent(dbFilePath string, event *DgUpdateEvent) error

func SendEvent

func SendEvent(client *client.GatewayClient, event []DgUpdateEvent) error

Types

type DgEvent

type DgEvent struct {
	CorrelationId string `json:"correlationId"`
	Success       *bool  `json:"success"`
	TargetName    string `json:"targetName"`
	Version       string `json:"version"`
	Details       string `json:"details,omitempty"`
}

type DgEventType

type DgEventType struct {
	Id      EventTypeValue `json:"id"`
	Version int            `json:"version"`
}

type DgUpdateEvent

type DgUpdateEvent struct {
	Id         string      `json:"id"`
	DeviceTime string      `json:"deviceTime"`
	Event      DgEvent     `json:"event"`
	EventType  DgEventType `json:"eventType"`
}

func GetEvents

func GetEvents(dbFilePath string) ([]DgUpdateEvent, int, error)

func NewEvent

func NewEvent(eventType EventTypeValue, details string, success *bool, correlationId string, targetName string, version int) []DgUpdateEvent

type EventTypeValue

type EventTypeValue string
const (
	DownloadStarted       EventTypeValue = "EcuDownloadStarted"
	DownloadCompleted     EventTypeValue = "EcuDownloadCompleted"
	InstallationStarted   EventTypeValue = "EcuInstallationStarted"
	InstallationApplied   EventTypeValue = "EcuInstallationApplied"
	InstallationCompleted EventTypeValue = "EcuInstallationCompleted"
)

Jump to

Keyboard shortcuts

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