unified gateway interface

This commit is contained in:
Stephan D
2025-12-31 17:47:32 +01:00
parent 19b7b69bd8
commit 97ba7500dc
104 changed files with 8228 additions and 1742 deletions

View File

@@ -11,4 +11,11 @@ const (
NAArchived NotificationAction = "archived"
NASent NotificationAction = "sent"
NAPasswordReset NotificationAction = "password_reset"
NADiscoveryServiceAnnounce NotificationAction = "service.announce"
NADiscoveryGatewayAnnounce NotificationAction = "gateway.announce"
NADiscoveryHeartbeat NotificationAction = "service.heartbeat"
NADiscoveryLookupRequest NotificationAction = "request.lookup"
NADiscoveryLookupResponse NotificationAction = "response.lookup"
NADiscoveryRefreshUI NotificationAction = "event.refresh_ui"
)

View File

@@ -36,7 +36,11 @@ func (ne *NotificationEventImp) Equals(other *NotificationEventImp) bool {
}
func (ne *NotificationEventImp) ToString() string {
return ne.StringType() + messageDelimiter + ne.StringAction()
action := ne.StringAction()
if strings.Contains(action, ".") {
return ne.StringType() + "." + action
}
return ne.StringType() + messageDelimiter + action
}
func (ne *NotificationEventImp) StringType() string {
@@ -76,7 +80,13 @@ func StringToNotificationAction(s string) (nm.NotificationAction, error) {
nm.NAUpdated,
nm.NADeleted,
nm.NAAssigned,
nm.NAPasswordReset:
nm.NAPasswordReset,
nm.NADiscoveryServiceAnnounce,
nm.NADiscoveryGatewayAnnounce,
nm.NADiscoveryHeartbeat,
nm.NADiscoveryLookupRequest,
nm.NADiscoveryLookupResponse,
nm.NADiscoveryRefreshUI:
return nm.NotificationAction(s), nil
default:
return "", merrors.DataConflict("invalid Notification action: " + s)