Fixing golang linters for VGC
Change-Id: I386d232c74ab47e24d92c18800dc144120b920da
diff --git a/internal/pkg/application/flowevent.go b/internal/pkg/application/flowevent.go
index fe37b74..be52fbb 100644
--- a/internal/pkg/application/flowevent.go
+++ b/internal/pkg/application/flowevent.go
@@ -24,45 +24,45 @@
"voltha-go-controller/log"
)
-//Generic Framework to enabling all flow based event trigger and handling.
-//The eventMapper can be updated for dynamic func caller for future events
+// Generic Framework to enabling all flow based event trigger and handling.
+// The eventMapper can be updated for dynamic func caller for future events
-//FlowEventType - Type of event enumeration
+// FlowEventType - Type of event enumeration
type FlowEventType string
-//FlowEventHandler - Func prototype for flow event handling funcs
+// FlowEventHandler - Func prototype for flow event handling funcs
type FlowEventHandler func(context.Context, *FlowEvent, intf.FlowStatus)
var eventMapper map[FlowEventType]FlowEventHandler
const (
- //EventTypeUsIgmpFlowAdded - Event type for IGMP US flow add
+ // EventTypeUsIgmpFlowAdded - Event type for IGMP US flow add
EventTypeUsIgmpFlowAdded FlowEventType = "USIgmpFlowAdded"
- //EventTypeServiceFlowAdded - Event type for Service flow add
+ // EventTypeServiceFlowAdded - Event type for Service flow add
EventTypeServiceFlowAdded FlowEventType = "ServiceFlowAdded"
- //EventTypeControlFlowAdded - Event type for Control flow add
+ // EventTypeControlFlowAdded - Event type for Control flow add
EventTypeControlFlowAdded FlowEventType = "ControlFlowAdded"
- //EventTypeDeviceFlowRemoved - Event type for Device flow del
+ // EventTypeDeviceFlowRemoved - Event type for Device flow del
EventTypeDeviceFlowRemoved FlowEventType = "DeviceFlowRemoved"
- //EventTypeMcastFlowRemoved - Event type for Mcast flow del
+ // EventTypeMcastFlowRemoved - Event type for Mcast flow del
EventTypeMcastFlowRemoved FlowEventType = "McastFlowRemoved"
- //EventTypeServiceFlowRemoved - Event type for Service flow del
+ // EventTypeServiceFlowRemoved - Event type for Service flow del
EventTypeServiceFlowRemoved FlowEventType = "ServiceFlowRemoved"
- //EventTypeControlFlowRemoved - Event type for Control flow del
+ // EventTypeControlFlowRemoved - Event type for Control flow del
EventTypeControlFlowRemoved FlowEventType = "ControlFlowRemoved"
)
-//FlowEvent - Event info for Flow event processing
+// FlowEvent - Event info for Flow event processing
type FlowEvent struct {
- eType FlowEventType
+ eventData interface{}
device string
cookie string
- eventData interface{}
+ eType FlowEventType
}
-//InitEventFuncMapper - Initialization of flow event mapper
+// InitEventFuncMapper - Initialization of flow event mapper
func InitEventFuncMapper() {
eventMapper = map[FlowEventType]FlowEventHandler{
EventTypeUsIgmpFlowAdded: ProcessUsIgmpFlowAddEvent,
@@ -75,7 +75,7 @@
}
}
-//ExecuteFlowEvent - Process flow based event triggers
+// ExecuteFlowEvent - Process flow based event triggers
func ExecuteFlowEvent(cntx context.Context, vd *VoltDevice, cookie string, flowStatus intf.FlowStatus) bool {
var event interface{}
@@ -98,9 +98,8 @@
return true
}
-//ProcessUsIgmpFlowAddEvent - Process Us Igmp Flow event trigger
+// ProcessUsIgmpFlowAddEvent - Process Us Igmp Flow event trigger
func ProcessUsIgmpFlowAddEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Add Event for US Igmp", log.Fields{"Cookie": event.cookie, "event": event})
vpv := event.eventData.(*VoltPortVnet)
if isFlowStatusSuccess(flowStatus.Status, true) {
@@ -110,9 +109,8 @@
}
}
-//ProcessServiceFlowAddEvent - Process Service Flow event trigger
+// ProcessServiceFlowAddEvent - Process Service Flow event trigger
func ProcessServiceFlowAddEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Add Event for Service", log.Fields{"Cookie": event.cookie, "event": event})
vs := event.eventData.(*VoltService)
if isFlowStatusSuccess(flowStatus.Status, true) {
@@ -122,9 +120,8 @@
}
}
-//ProcessControlFlowAddEvent - Process Control Flow event trigger
+// ProcessControlFlowAddEvent - Process Control Flow event trigger
func ProcessControlFlowAddEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Add Event for VPV", log.Fields{"Cookie": event.cookie, "event": event})
vpv := event.eventData.(*VoltPortVnet)
if !isFlowStatusSuccess(flowStatus.Status, true) {
@@ -132,9 +129,8 @@
}
}
-//ProcessServiceFlowDelEvent - Process Service Flow event trigger
+// ProcessServiceFlowDelEvent - Process Service Flow event trigger
func ProcessServiceFlowDelEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Remove Event for Service", log.Fields{"Cookie": event.cookie, "event": event})
vs := event.eventData.(*VoltService)
if isFlowStatusSuccess(flowStatus.Status, false) {
@@ -144,9 +140,8 @@
}
}
-//ProcessControlFlowDelEvent - Process Control Flow event trigger
+// ProcessControlFlowDelEvent - Process Control Flow event trigger
func ProcessControlFlowDelEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Remove Event for VPV", log.Fields{"Cookie": event.cookie, "event": event})
vpv := event.eventData.(*VoltPortVnet)
if isFlowStatusSuccess(flowStatus.Status, false) {
@@ -156,9 +151,8 @@
}
}
-//ProcessMcastFlowDelEvent - Process Control Flow event trigger
+// ProcessMcastFlowDelEvent - Process Control Flow event trigger
func ProcessMcastFlowDelEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Remove Event for Mcast/Igmp", log.Fields{"Cookie": event.cookie, "event": event})
mvp := event.eventData.(*MvlanProfile)
if isFlowStatusSuccess(flowStatus.Status, false) {
@@ -168,9 +162,8 @@
}
}
-//ProcessDeviceFlowDelEvent - Process Control Flow event trigger
+// ProcessDeviceFlowDelEvent - Process Control Flow event trigger
func ProcessDeviceFlowDelEvent(cntx context.Context, event *FlowEvent, flowStatus intf.FlowStatus) {
-
logger.Infow(ctx, "Processing Post Flow Remove Event for VNET", log.Fields{"Cookie": event.cookie, "event": event})
vnet := event.eventData.(*VoltVnet)
if isFlowStatusSuccess(flowStatus.Status, false) {
@@ -180,7 +173,7 @@
}
}
-//TODO: Update the func or flowStatus struct once all flow status are based on NB error code
+// TODO: Update the func or flowStatus struct once all flow status are based on NB error code
func isFlowStatusSuccess(status uint32, flowAdd bool) bool {
result := false
errorCode := infraerrorcode.ErrorCode(status)