Documentation
¶
Index ¶
- func CreateEventsTable(dbFilePath string) error
- func DeleteEvents(dbFilePath string, maxId int) error
- func FlushEvents(dbFilePath string, client *client.GatewayClient) error
- func SaveEvent(dbFilePath string, event *DgUpdateEvent) error
- type DgEvent
- type DgEventType
- type DgUpdateEvent
- type EnqueueEventOption
- type EnqueueEventOptions
- type EventSender
- type EventTypeValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEventsTable ¶
func DeleteEvents ¶
func FlushEvents ¶
func FlushEvents(dbFilePath string, client *client.GatewayClient) error
func SaveEvent ¶
func SaveEvent(dbFilePath string, event *DgUpdateEvent) error
Types ¶
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"`
}
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 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]" )
Click to show internal directories.
Click to hide internal directories.