File tree Expand file tree Collapse file tree 7 files changed +16
-16
lines changed
Expand file tree Collapse file tree 7 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -143,9 +143,9 @@ package examplegateway
143143
144144import " github.com/kubernetes-sigs/ingress2gateway/pkg/i2gw/notifications"
145145
146- func notify (mType notifications .MessageType , message string ) {
147- newNotification := notifications.Notification {Type: mType, Message: message}
148- notifications.CommonNotification . DispatchNotication (newNotification, string (ProviderName))
146+ func notify (mType notifications .MessageType , message string , callingObjects ... client . Object ) {
147+ newNotification := notifications.NewNotification ( mType, message, callingObjects...)
148+ notifications.NotificationAggr . DispatchNotification (newNotification, string (ProviderName))
149149}
150150```
1511517 . Import the new package at ` cmd/print ` .
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ var NotificationAggr NotificationAggregator
5353
5454// NotificationCallback is a callback function used to send notifications from within the common
5555// package without the common package having knowledge about which provider is making a call it
56- type NotificationCallback func (mType MessageType , message string , callingObject ... client.Object )
56+ type NotificationCallback func (mType MessageType , message string , CallingObjects ... client.Object )
5757
5858// DispatchNotification is used to send a notification to the NotificationAggregator
5959func (na * NotificationAggregator ) DispatchNotification (notification Notification , ProviderName string ) {
@@ -103,6 +103,6 @@ func convertObjectsToStr(ob []client.Object) string {
103103 return sb .String ()
104104}
105105
106- func NewNotification (mType MessageType , message string , callingObject ... client.Object ) Notification {
107- return Notification {Type : mType , Message : message , CallingObjects : callingObject }
106+ func NewNotification (mType MessageType , message string , callingObjects ... client.Object ) Notification {
107+ return Notification {Type : mType , Message : message , CallingObjects : callingObjects }
108108}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
2121 "sigs.k8s.io/controller-runtime/pkg/client"
2222)
2323
24- func notify (mType notifications.MessageType , message string , callingObject ... client.Object ) {
25- newNotification := notifications .NewNotification (mType , message , callingObject ... )
24+ func notify (mType notifications.MessageType , message string , callingObjects ... client.Object ) {
25+ newNotification := notifications .NewNotification (mType , message , callingObjects ... )
2626 notifications .NotificationAggr .DispatchNotification (newNotification , string (Name ))
2727}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
2121 "sigs.k8s.io/controller-runtime/pkg/client"
2222)
2323
24- func notify (mType notifications.MessageType , message string , callingObject ... client.Object ) {
25- newNotification := notifications .NewNotification (mType , message , callingObject ... )
24+ func notify (mType notifications.MessageType , message string , callingObjects ... client.Object ) {
25+ newNotification := notifications .NewNotification (mType , message , callingObjects ... )
2626 notifications .NotificationAggr .DispatchNotification (newNotification , string (ProviderName ))
2727}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
2121 "sigs.k8s.io/controller-runtime/pkg/client"
2222)
2323
24- func notify (mType notifications.MessageType , message string , callingObject ... client.Object ) {
25- newNotification := notifications .NewNotification (mType , message , callingObject ... )
24+ func notify (mType notifications.MessageType , message string , callingObjects ... client.Object ) {
25+ newNotification := notifications .NewNotification (mType , message , callingObjects ... )
2626 notifications .NotificationAggr .DispatchNotification (newNotification , string (Name ))
2727}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
2121 "sigs.k8s.io/controller-runtime/pkg/client"
2222)
2323
24- func notify (mType notifications.MessageType , message string , callingObject ... client.Object ) {
25- newNotification := notifications .NewNotification (mType , message , callingObject ... )
24+ func notify (mType notifications.MessageType , message string , callingObjects ... client.Object ) {
25+ newNotification := notifications .NewNotification (mType , message , callingObjects ... )
2626 notifications .NotificationAggr .DispatchNotification (newNotification , string (ProviderName ))
2727}
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ import (
2121 "sigs.k8s.io/controller-runtime/pkg/client"
2222)
2323
24- func notify (mType notifications.MessageType , message string , callingObject ... client.Object ) {
25- newNotification := notifications .NewNotification (mType , message , callingObject ... )
24+ func notify (mType notifications.MessageType , message string , callingObjects ... client.Object ) {
25+ newNotification := notifications .NewNotification (mType , message , callingObjects ... )
2626 notifications .NotificationAggr .DispatchNotification (newNotification , string (Name ))
2727}
2828
You can’t perform that action at this time.
0 commit comments