2023-01-06 12:21:14 +00:00
|
|
|
package pairing
|
2022-01-27 09:52:13 +00:00
|
|
|
|
|
|
|
// EventType type for event types.
|
|
|
|
type EventType string
|
|
|
|
|
|
|
|
const (
|
2023-02-27 11:46:46 +00:00
|
|
|
// Both Sender and Receiver
|
2022-01-27 09:52:13 +00:00
|
|
|
|
2023-02-15 14:42:12 +00:00
|
|
|
EventConnectionError EventType = "connection-error"
|
2022-01-27 09:52:13 +00:00
|
|
|
EventConnectionSuccess EventType = "connection-success"
|
2023-02-15 14:42:12 +00:00
|
|
|
EventTransferError EventType = "transfer-error"
|
|
|
|
EventTransferSuccess EventType = "transfer-success"
|
2022-01-27 09:52:13 +00:00
|
|
|
|
2023-02-27 11:46:46 +00:00
|
|
|
// Only Receiver side
|
|
|
|
|
|
|
|
EventReceivedAccount EventType = "received-account"
|
|
|
|
EventProcessSuccess EventType = "process-success"
|
|
|
|
EventProcessError EventType = "process-error"
|
2022-01-27 09:52:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Event is a type for transfer events.
|
|
|
|
type Event struct {
|
2023-01-06 12:21:14 +00:00
|
|
|
Type EventType `json:"type"`
|
|
|
|
Error string `json:"error,omitempty"`
|
|
|
|
Action Action `json:"action"`
|
2023-02-27 11:46:46 +00:00
|
|
|
Data any `json:"data,omitempty"`
|
2022-01-27 09:52:13 +00:00
|
|
|
}
|
2023-01-06 12:21:14 +00:00
|
|
|
|
|
|
|
type Action int
|
|
|
|
|
|
|
|
const (
|
2023-01-31 08:47:30 +00:00
|
|
|
ActionConnect = iota + 1
|
|
|
|
ActionPairingAccount
|
2023-01-06 12:21:14 +00:00
|
|
|
ActionSyncDevice
|
2023-02-28 12:32:45 +00:00
|
|
|
ActionPairingInstallation
|
2023-01-06 12:21:14 +00:00
|
|
|
)
|