events

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: BSD-3-Clause-Clear Imports: 14 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

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)

type EnqueueEventOption added in v1.1.0

type EnqueueEventOption func(*EnqueueEventOptions)

func WithEventDetails added in v1.1.0

func WithEventDetails(details string) EnqueueEventOption

func WithEventStatus added in v1.1.0

func WithEventStatus(success bool) EnqueueEventOption

type EnqueueEventOptions added in v1.1.0

type EnqueueEventOptions struct {
	Success *bool
	Details string
}

type EventSender added in v0.2.0

type EventSender struct {
	// contains filtered or unexported fields
}

func NewEventSender added in v0.2.0

func NewEventSender(cfg *config.Config, gwClient *client.GatewayClient) (*EventSender, error)

func (*EventSender) EnqueueEvent added in v0.2.0

func (s *EventSender) EnqueueEvent(eventType EventTypeValue, updateID string, toTarget target.Target, options ...EnqueueEventOption) error

func (*EventSender) FlushEventsAsync added in v0.2.0

func (s *EventSender) FlushEventsAsync()

func (*EventSender) Start added in v0.2.0

func (s *EventSender) Start()

func (*EventSender) Stop added in v0.2.0

func (s *EventSender) Stop()

type EventTypeValue

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

	MaxDetailsSize  = 2048
	TruncatedSuffix = "...[TRUNCATED]"
)

Jump to

Keyboard shortcuts

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