Skip to content

Commit

Permalink
chore: Move http_wrapper dependency to util project (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainbourgeois authored Feb 8, 2024
1 parent 2ee1292 commit 6e410e0
Show file tree
Hide file tree
Showing 38 changed files with 405 additions and 408 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand All @@ -28,7 +28,7 @@ import (

// HTTPQueryAmData - Retrieves the access and mobility subscription data of a UE
func HTTPQueryAmData(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")
req.Params["servingPlmnId"] = c.Params.ByName("servingPlmnId")

Expand Down
8 changes: 4 additions & 4 deletions datarepository/api_amf3_gpp_access_registration_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand Down Expand Up @@ -56,7 +56,7 @@ func HTTPAmfContext3gpp(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, patchItemArray)
req := httpwrapper.NewRequest(c.Request, patchItemArray)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleAmfContext3gpp(req)
Expand Down Expand Up @@ -105,7 +105,7 @@ func HTTPCreateAmfContext3gpp(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, amf3GppAccessRegistration)
req := httpwrapper.NewRequest(c.Request, amf3GppAccessRegistration)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleCreateAmfContext3gpp(req)
Expand All @@ -126,7 +126,7 @@ func HTTPCreateAmfContext3gpp(c *gin.Context) {

// HTTPQueryAmfContext3gpp - Retrieves the AMF context data of a UE using 3gpp access
func HTTPQueryAmfContext3gpp(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleQueryAmfContext3gpp(req)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand Down Expand Up @@ -56,7 +56,7 @@ func HTTPAmfContextNon3gpp(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, patchItemArray)
req := httpwrapper.NewRequest(c.Request, patchItemArray)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleAmfContextNon3gpp(req)
Expand Down Expand Up @@ -105,7 +105,7 @@ func HTTPCreateAmfContextNon3gpp(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, amfNon3GppAccessRegistration)
req := httpwrapper.NewRequest(c.Request, amfNon3GppAccessRegistration)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleCreateAmfContextNon3gpp(req)
Expand All @@ -126,7 +126,7 @@ func HTTPCreateAmfContextNon3gpp(c *gin.Context) {

// HTTPQueryAmfContextNon3gpp - Retrieves the AMF context data of a UE using non-3gpp access
func HTTPQueryAmfContextNon3gpp(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleQueryAmfContextNon3gpp(req)
Expand Down
4 changes: 2 additions & 2 deletions datarepository/api_amf_subscription_info_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand Down Expand Up @@ -56,7 +56,7 @@ func HTTPModifyAmfSubscriptionInfo(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, patchItemArray)
req := httpwrapper.NewRequest(c.Request, patchItemArray)
req.Params["ueId"] = c.Params.ByName("ueId")
req.Params["subsId"] = c.Params.ByName("subsId")

Expand Down
6 changes: 3 additions & 3 deletions datarepository/api_authentication_data_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand Down Expand Up @@ -56,7 +56,7 @@ func HTTPModifyAuthentication(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, patchItemArray)
req := httpwrapper.NewRequest(c.Request, patchItemArray)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleModifyAuthentication(req)
Expand All @@ -77,7 +77,7 @@ func HTTPModifyAuthentication(c *gin.Context) {

// HTTPQueryAuthSubsData - Retrieves the authentication subscription data of a UE
func HTTPQueryAuthSubsData(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleQueryAuthSubsData(req)
Expand Down
6 changes: 3 additions & 3 deletions datarepository/api_authentication_so_r_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand Down Expand Up @@ -56,7 +56,7 @@ func HTTPCreateAuthenticationSoR(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, sorData)
req := httpwrapper.NewRequest(c.Request, sorData)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleCreateAuthenticationSoR(req)
Expand All @@ -77,7 +77,7 @@ func HTTPCreateAuthenticationSoR(c *gin.Context) {

// HTTPQueryAuthSoR - Retrieves the SoR acknowledgement information of a UE
func HTTPQueryAuthSoR(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleQueryAuthSoR(req)
Expand Down
6 changes: 3 additions & 3 deletions datarepository/api_authentication_status_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
Expand Down Expand Up @@ -56,7 +56,7 @@ func HTTPCreateAuthenticationStatus(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, authEvent)
req := httpwrapper.NewRequest(c.Request, authEvent)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleCreateAuthenticationStatus(req)
Expand All @@ -77,7 +77,7 @@ func HTTPCreateAuthenticationStatus(c *gin.Context) {

// HTTPQueryAuthenticationStatus - Retrieves the Authentication Status of a UE
func HTTPQueryAuthenticationStatus(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandleQueryAuthenticationStatus(req)
Expand Down
46 changes: 23 additions & 23 deletions datarepository/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import (

"github.com/gin-gonic/gin"

"github.com/omec-project/http_wrapper"
"github.com/omec-project/util/httpwrapper"
"github.com/omec-project/openapi"
"github.com/omec-project/openapi/models"
"github.com/omec-project/udr/logger"
"github.com/omec-project/udr/producer"
"github.com/omec-project/udr/util"
)

func sendResponse(c *gin.Context, rsp *http_wrapper.Response) {
func sendResponse(c *gin.Context, rsp *httpwrapper.Response) {
for k, v := range rsp.Header {
// TODO: concatenate all values
c.Header(k, v[0])
Expand Down Expand Up @@ -198,7 +198,7 @@ func HTTPExposureDataSubsToNotifySubIdPut(c *gin.Context) {

// HTTPPolicyDataBdtDataBdtReferenceIdDelete -
func HTTPPolicyDataBdtDataBdtReferenceIdDelete(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["bdtReferenceId"] = c.Params.ByName("bdtReferenceId")

rsp := producer.HandlePolicyDataBdtDataBdtReferenceIdDelete(req)
Expand All @@ -208,7 +208,7 @@ func HTTPPolicyDataBdtDataBdtReferenceIdDelete(c *gin.Context) {

// HTTPPolicyDataBdtDataBdtReferenceIdGet -
func HTTPPolicyDataBdtDataBdtReferenceIdGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["bdtReferenceId"] = c.Params.ByName("bdtReferenceId")

rsp := producer.HandlePolicyDataBdtDataBdtReferenceIdGet(req)
Expand All @@ -224,7 +224,7 @@ func HTTPPolicyDataBdtDataBdtReferenceIdPut(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, bdtData)
req := httpwrapper.NewRequest(c.Request, bdtData)
req.Params["bdtReferenceId"] = c.Params.ByName("bdtReferenceId")

rsp := producer.HandlePolicyDataBdtDataBdtReferenceIdPut(req)
Expand All @@ -234,7 +234,7 @@ func HTTPPolicyDataBdtDataBdtReferenceIdPut(c *gin.Context) {

// HTTPPolicyDataBdtDataGet -
func HTTPPolicyDataBdtDataGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)

rsp := producer.HandlePolicyDataBdtDataGet(req)

Expand All @@ -243,7 +243,7 @@ func HTTPPolicyDataBdtDataGet(c *gin.Context) {

// HTTPPolicyDataPlmnsPlmnIdUePolicySetGet -
func HTTPPolicyDataPlmnsPlmnIdUePolicySetGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["plmnId"] = c.Params.ByName("plmnId")

rsp := producer.HandlePolicyDataPlmnsPlmnIdUePolicySetGet(req)
Expand All @@ -253,7 +253,7 @@ func HTTPPolicyDataPlmnsPlmnIdUePolicySetGet(c *gin.Context) {

// HTTPPolicyDataSponsorConnectivityDataSponsorIdGet -
func HTTPPolicyDataSponsorConnectivityDataSponsorIdGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["sponsorId"] = c.Params.ByName("sponsorId")

rsp := producer.HandlePolicyDataSponsorConnectivityDataSponsorIdGet(req)
Expand All @@ -269,7 +269,7 @@ func HTTPPolicyDataSubsToNotifyPost(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, policyDataSubscription)
req := httpwrapper.NewRequest(c.Request, policyDataSubscription)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataSubsToNotifyPost(req)
Expand All @@ -283,7 +283,7 @@ func HTTPPolicyDataSubsToNotifyPost(c *gin.Context) {

// HTTPPolicyDataSubsToNotifySubsIdDelete -
func HTTPPolicyDataSubsToNotifySubsIdDelete(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["subsId"] = c.Params.ByName("subsId")

rsp := producer.HandlePolicyDataSubsToNotifySubsIdDelete(req)
Expand All @@ -299,7 +299,7 @@ func HTTPPolicyDataSubsToNotifySubsIdPut(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, policyDataSubscription)
req := httpwrapper.NewRequest(c.Request, policyDataSubscription)
req.Params["subsId"] = c.Params.ByName("subsId")

rsp := producer.HandlePolicyDataSubsToNotifySubsIdPut(req)
Expand All @@ -309,7 +309,7 @@ func HTTPPolicyDataSubsToNotifySubsIdPut(c *gin.Context) {

// HTTPPolicyDataUesUeIdAmDataGet -
func HTTPPolicyDataUesUeIdAmDataGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdAmDataGet(req)
Expand All @@ -319,7 +319,7 @@ func HTTPPolicyDataUesUeIdAmDataGet(c *gin.Context) {

// HTTPPolicyDataUesUeIdOperatorSpecificDataGet -
func HTTPPolicyDataUesUeIdOperatorSpecificDataGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdOperatorSpecificDataGet(req)
Expand All @@ -335,7 +335,7 @@ func HTTPPolicyDataUesUeIdOperatorSpecificDataPatch(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, patchItemArray)
req := httpwrapper.NewRequest(c.Request, patchItemArray)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdOperatorSpecificDataPatch(req)
Expand All @@ -351,7 +351,7 @@ func HTTPPolicyDataUesUeIdOperatorSpecificDataPut(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, operatorSpecificDataContainerMap)
req := httpwrapper.NewRequest(c.Request, operatorSpecificDataContainerMap)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdOperatorSpecificDataPut(req)
Expand All @@ -361,7 +361,7 @@ func HTTPPolicyDataUesUeIdOperatorSpecificDataPut(c *gin.Context) {

// HTTPPolicyDataUesUeIdSmDataGet -
func HTTPPolicyDataUesUeIdSmDataGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdSmDataGet(req)
Expand All @@ -377,7 +377,7 @@ func HTTPPolicyDataUesUeIdSmDataPatch(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, usageMonDataMap)
req := httpwrapper.NewRequest(c.Request, usageMonDataMap)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdSmDataPatch(req)
Expand All @@ -387,7 +387,7 @@ func HTTPPolicyDataUesUeIdSmDataPatch(c *gin.Context) {

// HTTPPolicyDataUesUeIdSmDataUsageMonIdDelete -
func HTTPPolicyDataUesUeIdSmDataUsageMonIdDelete(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")
req.Params["usageMonId"] = c.Params.ByName("usageMonId")

Expand All @@ -398,7 +398,7 @@ func HTTPPolicyDataUesUeIdSmDataUsageMonIdDelete(c *gin.Context) {

// HTTPPolicyDataUesUeIdSmDataUsageMonIdGet -
func HTTPPolicyDataUesUeIdSmDataUsageMonIdGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")
req.Params["usageMonId"] = c.Params.ByName("usageMonId")

Expand All @@ -415,7 +415,7 @@ func HTTPPolicyDataUesUeIdSmDataUsageMonIdPut(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, usageMonData)
req := httpwrapper.NewRequest(c.Request, usageMonData)
req.Params["ueId"] = c.Params.ByName("ueId")
req.Params["usageMonId"] = c.Params.ByName("usageMonId")

Expand All @@ -426,7 +426,7 @@ func HTTPPolicyDataUesUeIdSmDataUsageMonIdPut(c *gin.Context) {

// HTTPPolicyDataUesUeIdUePolicySetGet -
func HTTPPolicyDataUesUeIdUePolicySetGet(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req := httpwrapper.NewRequest(c.Request, nil)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdUePolicySetGet(req)
Expand All @@ -442,7 +442,7 @@ func HTTPPolicyDataUesUeIdUePolicySetPatch(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, uePolicySet)
req := httpwrapper.NewRequest(c.Request, uePolicySet)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdUePolicySetPatch(req)
Expand All @@ -458,7 +458,7 @@ func HTTPPolicyDataUesUeIdUePolicySetPut(c *gin.Context) {
return
}

req := http_wrapper.NewRequest(c.Request, uePolicySet)
req := httpwrapper.NewRequest(c.Request, uePolicySet)
req.Params["ueId"] = c.Params.ByName("ueId")

rsp := producer.HandlePolicyDataUesUeIdUePolicySetPut(req)
Expand Down
Loading

0 comments on commit 6e410e0

Please sign in to comment.