@@ -91,8 +91,8 @@ func (service *HTTPRestService) requestIPConfigHandlerHelper(ctx context.Context
9191 }, nil
9292}
9393
94- // requestIPConfigHandler requests an IPConfig from the CNS state
95- func (service * HTTPRestService ) requestIPConfigHandler (w http.ResponseWriter , r * http.Request ) {
94+ // RequestIPConfigHandler requests an IPConfig from the CNS state
95+ func (service * HTTPRestService ) RequestIPConfigHandler (w http.ResponseWriter , r * http.Request ) {
9696 var ipconfigRequest cns.IPConfigRequest
9797 err := service .Listener .Decode (w , r , & ipconfigRequest )
9898 operationName := "requestIPConfigHandler"
@@ -166,8 +166,8 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r
166166 logger .ResponseEx (service .Name + operationName , ipconfigsRequest , reserveResp , reserveResp .Response .ReturnCode , err )
167167}
168168
169- // requestIPConfigsHandler requests multiple IPConfigs from the CNS state
170- func (service * HTTPRestService ) requestIPConfigsHandler (w http.ResponseWriter , r * http.Request ) {
169+ // RequestIPConfigsHandler requests multiple IPConfigs from the CNS state
170+ func (service * HTTPRestService ) RequestIPConfigsHandler (w http.ResponseWriter , r * http.Request ) {
171171 var ipconfigsRequest cns.IPConfigsRequest
172172 err := service .Listener .Decode (w , r , & ipconfigsRequest )
173173 operationName := "requestIPConfigsHandler"
@@ -180,7 +180,7 @@ func (service *HTTPRestService) requestIPConfigsHandler(w http.ResponseWriter, r
180180 // Check if IPConfigsHandlerMiddleware is set
181181 if service .IPConfigsHandlerMiddleware != nil {
182182 // Wrap the default datapath handlers with the middleware
183- wrappedHandler := service .IPConfigsHandlerMiddleware .IPConfigsRequestHandlerWrapper (service .requestIPConfigHandlerHelper , service .releaseIPConfigHandlerHelper )
183+ wrappedHandler := service .IPConfigsHandlerMiddleware .IPConfigsRequestHandlerWrapper (service .requestIPConfigHandlerHelper , service .ReleaseIPConfigHandlerHelper )
184184 ipConfigsResp , err = wrappedHandler (r .Context (), ipconfigsRequest )
185185 } else {
186186 ipConfigsResp , err = service .requestIPConfigHandlerHelper (r .Context (), ipconfigsRequest ) // nolint:contextcheck // appease linter
@@ -260,8 +260,8 @@ func (service *HTTPRestService) updateEndpointState(ipconfigsRequest cns.IPConfi
260260 return nil
261261}
262262
263- // releaseIPConfigHandlerHelper validates the request and removes the endpoint associated with the pod
264- func (service * HTTPRestService ) releaseIPConfigHandlerHelper (ctx context.Context , ipconfigsRequest cns.IPConfigsRequest ) (* cns.IPConfigsResponse , error ) {
263+ // ReleaseIPConfigHandlerHelper validates the request and removes the endpoint associated with the pod
264+ func (service * HTTPRestService ) ReleaseIPConfigHandlerHelper (ctx context.Context , ipconfigsRequest cns.IPConfigsRequest ) (* cns.IPConfigsResponse , error ) {
265265 podInfo , returnCode , returnMessage := service .validateIPConfigsRequest (ctx , ipconfigsRequest )
266266 if returnCode != types .Success {
267267 return & cns.IPConfigsResponse {
@@ -280,7 +280,7 @@ func (service *HTTPRestService) releaseIPConfigHandlerHelper(ctx context.Context
280280 Message : err .Error (),
281281 },
282282 }
283- return resp , fmt .Errorf ("releaseIPConfigHandlerHelper remove endpoint state failed : %v, release IP config info %+v" , resp .Response .Message , ipconfigsRequest ) //nolint:goerr113 // return error
283+ return resp , fmt .Errorf ("ReleaseIPConfigHandlerHelper remove endpoint state failed : %v, release IP config info %+v" , resp .Response .Message , ipconfigsRequest ) //nolint:goerr113 // return error
284284 }
285285 }
286286
@@ -290,7 +290,7 @@ func (service *HTTPRestService) releaseIPConfigHandlerHelper(ctx context.Context
290290 ReturnCode : types .UnexpectedError ,
291291 Message : err .Error (),
292292 },
293- }, fmt .Errorf ("releaseIPConfigHandlerHelper releaseIPConfigs failed : %v, release IP config info %+v" , returnMessage , ipconfigsRequest ) //nolint:goerr113 // return error
293+ }, fmt .Errorf ("ReleaseIPConfigHandlerHelper releaseIPConfigs failed : %v, release IP config info %+v" , returnMessage , ipconfigsRequest ) //nolint:goerr113 // return error
294294 }
295295
296296 return & cns.IPConfigsResponse {
@@ -301,8 +301,8 @@ func (service *HTTPRestService) releaseIPConfigHandlerHelper(ctx context.Context
301301 }, nil
302302}
303303
304- // releaseIPConfigHandler frees the IP assigned to a pod from CNS
305- func (service * HTTPRestService ) releaseIPConfigHandler (w http.ResponseWriter , r * http.Request ) {
304+ // ReleaseIPConfigHandler frees the IP assigned to a pod from CNS
305+ func (service * HTTPRestService ) ReleaseIPConfigHandler (w http.ResponseWriter , r * http.Request ) {
306306 var ipconfigRequest cns.IPConfigRequest
307307 err := service .Listener .Decode (w , r , & ipconfigRequest )
308308 logger .Request (service .Name + "releaseIPConfigHandler" , ipconfigRequest , err )
@@ -342,7 +342,7 @@ func (service *HTTPRestService) releaseIPConfigHandler(w http.ResponseWriter, r
342342 Ifname : ipconfigRequest .Ifname ,
343343 }
344344
345- resp , err := service .releaseIPConfigHandlerHelper (r .Context (), ipconfigsRequest )
345+ resp , err := service .ReleaseIPConfigHandlerHelper (r .Context (), ipconfigsRequest )
346346 if err != nil {
347347 w .Header ().Set (cnsReturnCode , resp .Response .ReturnCode .String ())
348348 err = service .Listener .Encode (w , & resp )
@@ -354,8 +354,8 @@ func (service *HTTPRestService) releaseIPConfigHandler(w http.ResponseWriter, r
354354 logger .ResponseEx (service .Name , ipconfigRequest , resp , resp .Response .ReturnCode , err )
355355}
356356
357- // releaseIPConfigsHandler frees multiple IPConfigs from the CNS state
358- func (service * HTTPRestService ) releaseIPConfigsHandler (w http.ResponseWriter , r * http.Request ) {
357+ // ReleaseIPConfigsHandler frees multiple IPConfigs from the CNS state
358+ func (service * HTTPRestService ) ReleaseIPConfigsHandler (w http.ResponseWriter , r * http.Request ) {
359359 var ipconfigsRequest cns.IPConfigsRequest
360360 err := service .Listener .Decode (w , r , & ipconfigsRequest )
361361 logger .Request (service .Name + "releaseIPConfigsHandler" , ipconfigsRequest , err )
@@ -371,7 +371,7 @@ func (service *HTTPRestService) releaseIPConfigsHandler(w http.ResponseWriter, r
371371 return
372372 }
373373
374- resp , err := service .releaseIPConfigHandlerHelper (r .Context (), ipconfigsRequest )
374+ resp , err := service .ReleaseIPConfigHandlerHelper (r .Context (), ipconfigsRequest )
375375 if err != nil {
376376 w .Header ().Set (cnsReturnCode , resp .Response .ReturnCode .String ())
377377 err = service .Listener .Encode (w , & resp )
@@ -560,7 +560,7 @@ func (service *HTTPRestService) GetPodIPConfigState() map[string]cns.IPConfigura
560560 return podIPConfigState
561561}
562562
563- func (service * HTTPRestService ) handleDebugPodContext (w http.ResponseWriter , r * http.Request ) {
563+ func (service * HTTPRestService ) HandleDebugPodContext (w http.ResponseWriter , r * http.Request ) { //nolint
564564 service .RLock ()
565565 defer service .RUnlock ()
566566 resp := cns.GetPodContextResponse {
@@ -570,7 +570,7 @@ func (service *HTTPRestService) handleDebugPodContext(w http.ResponseWriter, r *
570570 logger .Response (service .Name , resp , resp .Response .ReturnCode , err )
571571}
572572
573- func (service * HTTPRestService ) handleDebugRestData (w http.ResponseWriter , r * http.Request ) {
573+ func (service * HTTPRestService ) HandleDebugRestData (w http.ResponseWriter , r * http.Request ) { //nolint
574574 service .RLock ()
575575 defer service .RUnlock ()
576576 resp := GetHTTPServiceDataResponse {
@@ -583,7 +583,7 @@ func (service *HTTPRestService) handleDebugRestData(w http.ResponseWriter, r *ht
583583 logger .Response (service .Name , resp , resp .Response .ReturnCode , err )
584584}
585585
586- func (service * HTTPRestService ) handleDebugIPAddresses (w http.ResponseWriter , r * http.Request ) {
586+ func (service * HTTPRestService ) HandleDebugIPAddresses (w http.ResponseWriter , r * http.Request ) {
587587 var req cns.GetIPAddressesRequest
588588 if err := service .Listener .Decode (w , r , & req ); err != nil {
589589 resp := cns.GetIPAddressStatusResponse {
0 commit comments