From c66152467644168d298c4ae454268c40e6438bf8 Mon Sep 17 00:00:00 2001 From: free5gc-org Date: Wed, 6 Oct 2021 03:34:37 +0000 Subject: [PATCH] upgrade packages version in go.mod and add golangci rules --- .drone.yml | 17 ++ .../api_individual_subscription_document.go | 5 +- .../api_individual_ue_context_document.go | 5 +- ...ext_n2_message_notify_callback_document.go | 5 +- ..._n1_n2_individual_subscription_document.go | 5 +- .../api_n1_n2_message_collection_document.go | 5 +- ...age_n1_message_notify_callback_document.go | 5 +- ...age_n2_message_notify_callback_document.go | 5 +- ...r_status_notification_callback_document.go | 5 +- ...ion_for_individual_ue_contexts_document.go | 5 +- ...cation_individual_subscription_document.go | 5 +- ...i_non_uen2_messages_collection_document.go | 5 +- ...sages_subscriptions_collection_document.go | 5 +- .../api_subscriptions_collection_document.go | 5 +- ..._status_change_notify_callback_document.go | 5 +- Namf_Communication/client_debug.go | 82 -------- Namf_Communication/logger/logger.go | 50 ----- .../api_individual_subscription_document.go | 5 +- .../api_subscriptions_collection_document.go | 5 +- Namf_EventExposure/client_debug.go | 57 ------ Namf_EventExposure/logger/logger.go | 50 ----- .../api_individual_ue_context_document.go | 6 +- Namf_Location/client_debug.go | 55 ------ Namf_MT/api_ue_context_document.go | 6 +- Namf_MT/api_ue_reach_ind_document.go | 6 +- Namf_MT/client_debug.go | 57 ------ Nausf_SoRProtection/api_default.go | 6 +- Nausf_SoRProtection/client_debug.go | 57 ------ Nausf_UEAuthentication/api_default.go | 6 +- Nausf_UEAuthentication/client_debug.go | 57 ------ Nausf_UPUProtection/api_default.go | 6 +- Nausf_UPUProtection/client_debug.go | 57 ------ .../api_individual_application_pfd.go | 6 +- .../api_individual_pfd_subscription.go | 6 +- Nnef_PFDmanagement/api_notification.go | 182 ++++++++++++++++++ Nnef_PFDmanagement/api_pfd_of_applications.go | 6 +- Nnef_PFDmanagement/api_pfd_subscriptions.go | 6 +- Nnef_PFDmanagement/client.go | 2 + Nnrf_AccessToken/api_access_token_request.go | 6 +- Nnrf_AccessToken/client_debug.go | 56 ------ Nnrf_AccessToken/configuration.go | 1 - Nnrf_NFDiscovery/api_nf_instances_store.go | 6 +- Nnrf_NFDiscovery/client_debug.go | 57 ------ .../api_nf_instance_id_document.go | 6 +- Nnrf_NFManagement/api_nf_instances_store.go | 6 +- .../api_subscription_id_document.go | 6 +- .../api_subscriptions_collection.go | 6 +- Nnrf_NFManagement/client_debug.go | 65 ------- Nnssf_NSSAIAvailability/logger/logger.go | 50 ----- Nnssf_NSSelection/logger/logger.go | 50 ----- Npcf_AMPolicy/api_default.go | 5 +- Npcf_AMPolicy/api_default_callback.go | 5 +- .../api_bdt_policies_collection.go | 6 +- .../api_individual_bdt_policy_document.go | 6 +- .../api_application_sessions_collection.go | 5 +- .../api_eventNotification_callback.go | 5 +- .../api_events_subscription_document.go | 5 +- ...al_application_session_context_document.go | 5 +- .../api_terminationRequest_callback.go | 5 +- .../api_dafult_notify_callback.go | 5 +- Npcf_SMPolicyControl/api_default.go | 6 +- Npcf_UEPolicy/api_default.go | 3 +- Npcf_UEPolicy/client.go | 3 +- Nsmf_EventExposure/api_default.go | 11 +- Nsmf_EventExposure/logger/logger.go | 50 ----- .../api_individual_pdu_session_hsmf.go | 5 +- Nsmf_PDUSession/api_individual_sm_context.go | 5 +- .../api_individual_sm_context_callback.go | 5 +- .../api_pdu_sessions_collection.go | 5 +- Nsmf_PDUSession/api_sm_contexts_collection.go | 5 +- Nsmf_PDUSession/client_debug.go | 63 ------ Nsmf_PDUSession/errors.go | 3 +- Nsmf_PDUSession/logger/logger.go | 50 ----- .../api_create_ee_subscription.go | 6 +- .../api_delete_ee_subscription.go | 6 +- .../api_update_ee_subscription.go | 6 +- Nudm_EventExposure/logger/logger.go | 50 ----- .../api_subscription_data_update.go | 6 +- Nudm_ParameterProvision/logger/logger.go | 50 ----- ...nd_mobility_subscription_data_retrieval.go | 6 +- .../api_gpsi_to_supi_translation.go | 6 +- ..._acknowledgement_of_steering_of_roaming.go | 6 +- ...acknowledgement_of_ue_parameters_update.go | 6 +- .../api_retrieval_of_multiple_data_sets.go | 6 +- .../api_retrieval_of_shared_data.go | 6 +- ..._management_subscription_data_retrieval.go | 6 +- ...e_selection_subscription_data_retrieval.go | 6 +- ...f_selection_subscription_data_retrieval.go | 6 +- ..._management_subscription_data_retrieval.go | 6 +- .../api_sms_subscription_data_retrieval.go | 6 +- ...on_data_change_notify_callback_document.go | 5 +- .../api_subscription_creation.go | 6 +- ...i_subscription_creation_for_shared_data.go | 6 +- .../api_subscription_deletion.go | 6 +- ...i_subscription_deletion_for_shared_data.go | 6 +- .../api_subscription_modification.go | 6 +- .../api_trace_configuration_data_retrieval.go | 6 +- .../api_ue_context_in_smf_data_retrieval.go | 6 +- .../api_ue_context_in_smsf_data_retrieval.go | 6 +- .../logger/logger.go | 50 ----- Nudm_UEAuthentication/api_confirm_auth.go | 6 +- .../api_generate_auth_data.go | 6 +- Nudm_UEAuthentication/logger/logger.go | 50 ----- ..._gpp_access_registration_info_retrieval.go | 6 +- ..._gpp_access_registration_info_retrieval.go | 6 +- .../api_amf_registration_for3_gpp_access.go | 6 +- ...pi_amf_registration_for_non3_gpp_access.go | 6 +- .../api_deregistrationNotification.go | 7 +- ...in_the_amf_registration_for3_gpp_access.go | 6 +- ...he_amf_registration_for_non3_gpp_access.go | 6 +- .../api_smf_deregistration.go | 6 +- .../api_smf_registration.go | 6 +- ..._gpp_access_registration_info_retrieval.go | 6 +- ...api_smsf_deregistration_for3_gpp_access.go | 6 +- ...smsf_deregistration_for_non3_gpp_access.go | 6 +- ..._gpp_access_registration_info_retrieval.go | 6 +- .../api_smsf_registration_for3_gpp_access.go | 6 +- ...i_smsf_registration_for_non3_gpp_access.go | 6 +- Nudm_UEContextManagement/logger/logger.go | 50 ----- .../api_access_and_mobility_data.go | 6 +- ...and_mobility_subscription_data_document.go | 6 +- ...i_amf3_gpp_access_registration_document.go | 6 +- ...f_non3_gpp_access_registration_document.go | 6 +- .../api_amf_subscription_info_document.go | 6 +- .../api_auth_event_document.go | 6 +- .../api_authentication_data_document.go | 6 +- .../api_authentication_so_r_document.go | 6 +- .../api_authentication_status_document.go | 6 +- ...i_create_amf_subscription_info_document.go | 6 +- Nudr_DataRepository/api_default.go | 6 +- ...pi_event_amf_subscription_info_document.go | 3 +- .../api_event_exposure_data_document.go | 6 +- ...exposure_group_subscriptions_collection.go | 6 +- ...pi_event_exposure_subscription_document.go | 6 +- ...event_exposure_subscriptions_collection.go | 6 +- ...erator_specific_data_container_document.go | 6 +- .../api_parameter_provision_document.go | 6 +- .../api_pdu_session_management_data.go | 6 +- .../api_provisioned_data_document.go | 6 +- ...api_provisioned_parameter_data_document.go | 6 +- ...pi_query_amf_subscription_info_document.go | 6 +- ..._identity_data_by_supi_or_gpsi_document.go | 6 +- ...query_odb_data_by_supi_or_gpsi_document.go | 6 +- .../api_retrieval_of_shared_data.go | 6 +- .../api_sdm_subscription_document.go | 6 +- .../api_sdm_subscriptions_collection.go | 6 +- ...pi_session_management_subscription_data.go | 6 +- .../api_smf_registration_document.go | 6 +- .../api_smf_registrations_collection.go | 6 +- ...mf_selection_subscription_data_document.go | 6 +- ...s_management_subscription_data_document.go | 6 +- .../api_sms_subscription_data_document.go | 6 +- .../api_smsf3_gpp_registration_document.go | 6 +- ...api_smsf_non3_gpp_registration_document.go | 6 +- .../api_subs_to_nofify_collection.go | 6 +- ...fy_data_change_notify_callback_document.go | 5 +- ...cy_data_change_notify_callback_document.go | 5 +- .../api_subs_to_notify_document.go | 4 +- .../api_trace_data_document.go | 6 +- Nudr_DataRepository/client_debug.go | 131 ------------- Nudr_DataRepository/logger/logger.go | 50 ----- PfdManagement/api_default.go | 6 +- ...api_subscription_level_delete_operation.go | 6 +- ...ce_api_subscription_level_get_operation.go | 6 +- ..._api_subscription_level_patch_operation.go | 6 +- ...e_api_subscription_level_post_operation.go | 6 +- ...ce_api_subscription_level_put_operation.go | 6 +- ..._influence_apiscsas_level_get_operation.go | 6 +- client.go | 4 +- convert_test.go | 6 +- go.mod | 16 +- go.sum | 104 ++-------- logger/logger.go | 50 ----- models/model_atom.go | 0 models/model_cnf.go | 0 models/model_cnf_unit.go | 0 models/model_complex_query.go | 0 models/model_dnf.go | 0 models/model_dnf_unit.go | 0 problem_details.go | 32 +++ serialize.go | 7 +- supported_feature_test.go | 89 +++++++++ 182 files changed, 765 insertions(+), 1939 deletions(-) create mode 100644 .drone.yml delete mode 100644 Namf_Communication/client_debug.go delete mode 100644 Namf_Communication/logger/logger.go delete mode 100644 Namf_EventExposure/client_debug.go delete mode 100644 Namf_EventExposure/logger/logger.go delete mode 100644 Namf_Location/client_debug.go delete mode 100644 Namf_MT/client_debug.go delete mode 100644 Nausf_SoRProtection/client_debug.go delete mode 100644 Nausf_UEAuthentication/client_debug.go delete mode 100644 Nausf_UPUProtection/client_debug.go create mode 100644 Nnef_PFDmanagement/api_notification.go delete mode 100644 Nnrf_AccessToken/client_debug.go delete mode 100644 Nnrf_NFDiscovery/client_debug.go delete mode 100644 Nnrf_NFManagement/client_debug.go delete mode 100644 Nnssf_NSSAIAvailability/logger/logger.go delete mode 100644 Nnssf_NSSelection/logger/logger.go delete mode 100644 Nsmf_EventExposure/logger/logger.go delete mode 100644 Nsmf_PDUSession/client_debug.go delete mode 100644 Nsmf_PDUSession/logger/logger.go delete mode 100644 Nudm_EventExposure/logger/logger.go delete mode 100644 Nudm_ParameterProvision/logger/logger.go delete mode 100644 Nudm_SubscriberDataManagement/logger/logger.go delete mode 100644 Nudm_UEAuthentication/logger/logger.go delete mode 100644 Nudm_UEContextManagement/logger/logger.go delete mode 100644 Nudr_DataRepository/client_debug.go delete mode 100644 Nudr_DataRepository/logger/logger.go delete mode 100644 logger/logger.go mode change 100755 => 100644 models/model_atom.go mode change 100755 => 100644 models/model_cnf.go mode change 100755 => 100644 models/model_cnf_unit.go mode change 100755 => 100644 models/model_complex_query.go mode change 100755 => 100644 models/model_dnf.go mode change 100755 => 100644 models/model_dnf_unit.go create mode 100644 problem_details.go create mode 100644 supported_feature_test.go diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..dfd7ef68 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +name: development + +steps: + #- name: Check coding style + # pull: never + # image: drone/base:golangci-lint + # depends_on: [ clone ] + # commands: + # - golangci-lint run ./... + + - name: Unit test and build + pull: never + image: drone/base:gotest + depends_on: [ clone ] + commands: + - gotestsum ./... -v -cover -race diff --git a/Namf_Communication/api_individual_subscription_document.go b/Namf_Communication/api_individual_subscription_document.go index 5b0dd7cc..83c64254 100644 --- a/Namf_Communication/api_individual_subscription_document.go +++ b/Namf_Communication/api_individual_subscription_document.go @@ -12,12 +12,13 @@ package Namf_Communication import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_individual_ue_context_document.go b/Namf_Communication/api_individual_ue_context_document.go index d1db176e..8de9a97c 100644 --- a/Namf_Communication/api_individual_ue_context_document.go +++ b/Namf_Communication/api_individual_ue_context_document.go @@ -12,12 +12,13 @@ package Namf_Communication import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_individual_ue_context_n2_message_notify_callback_document.go b/Namf_Communication/api_individual_ue_context_n2_message_notify_callback_document.go index 0b03bf61..f08ca74f 100644 --- a/Namf_Communication/api_individual_ue_context_n2_message_notify_callback_document.go +++ b/Namf_Communication/api_individual_ue_context_n2_message_notify_callback_document.go @@ -2,12 +2,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_n1_n2_individual_subscription_document.go b/Namf_Communication/api_n1_n2_individual_subscription_document.go index d4a6ba9e..3bedb6e5 100644 --- a/Namf_Communication/api_n1_n2_individual_subscription_document.go +++ b/Namf_Communication/api_n1_n2_individual_subscription_document.go @@ -12,12 +12,13 @@ package Namf_Communication import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_n1_n2_message_collection_document.go b/Namf_Communication/api_n1_n2_message_collection_document.go index 4bcf12f9..1af1b9c5 100644 --- a/Namf_Communication/api_n1_n2_message_collection_document.go +++ b/Namf_Communication/api_n1_n2_message_collection_document.go @@ -12,12 +12,13 @@ package Namf_Communication import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_n1_n2_message_n1_message_notify_callback_document.go b/Namf_Communication/api_n1_n2_message_n1_message_notify_callback_document.go index 543c3941..11068791 100644 --- a/Namf_Communication/api_n1_n2_message_n1_message_notify_callback_document.go +++ b/Namf_Communication/api_n1_n2_message_n1_message_notify_callback_document.go @@ -2,12 +2,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_n1_n2_message_n2_message_notify_callback_document.go b/Namf_Communication/api_n1_n2_message_n2_message_notify_callback_document.go index cf87bfdc..c65ca8de 100644 --- a/Namf_Communication/api_n1_n2_message_n2_message_notify_callback_document.go +++ b/Namf_Communication/api_n1_n2_message_n2_message_notify_callback_document.go @@ -2,12 +2,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_n1_n2_message_transfer_status_notification_callback_document.go b/Namf_Communication/api_n1_n2_message_transfer_status_notification_callback_document.go index abde86b1..c55a19a0 100644 --- a/Namf_Communication/api_n1_n2_message_transfer_status_notification_callback_document.go +++ b/Namf_Communication/api_n1_n2_message_transfer_status_notification_callback_document.go @@ -11,12 +11,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_n1_n2_subscriptions_collection_for_individual_ue_contexts_document.go b/Namf_Communication/api_n1_n2_subscriptions_collection_for_individual_ue_contexts_document.go index f90abad0..ffd5b02c 100644 --- a/Namf_Communication/api_n1_n2_subscriptions_collection_for_individual_ue_contexts_document.go +++ b/Namf_Communication/api_n1_n2_subscriptions_collection_for_individual_ue_contexts_document.go @@ -12,12 +12,13 @@ package Namf_Communication import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_non_uen2_message_notification_individual_subscription_document.go b/Namf_Communication/api_non_uen2_message_notification_individual_subscription_document.go index 68c2bcba..cf58a993 100644 --- a/Namf_Communication/api_non_uen2_message_notification_individual_subscription_document.go +++ b/Namf_Communication/api_non_uen2_message_notification_individual_subscription_document.go @@ -12,12 +12,13 @@ package Namf_Communication import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_non_uen2_messages_collection_document.go b/Namf_Communication/api_non_uen2_messages_collection_document.go index a8cbbe57..16c510ba 100644 --- a/Namf_Communication/api_non_uen2_messages_collection_document.go +++ b/Namf_Communication/api_non_uen2_messages_collection_document.go @@ -11,12 +11,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_non_uen2_messages_subscriptions_collection_document.go b/Namf_Communication/api_non_uen2_messages_subscriptions_collection_document.go index 4745e024..fb27a331 100644 --- a/Namf_Communication/api_non_uen2_messages_subscriptions_collection_document.go +++ b/Namf_Communication/api_non_uen2_messages_subscriptions_collection_document.go @@ -11,12 +11,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_subscriptions_collection_document.go b/Namf_Communication/api_subscriptions_collection_document.go index 494ac8e4..d089d976 100644 --- a/Namf_Communication/api_subscriptions_collection_document.go +++ b/Namf_Communication/api_subscriptions_collection_document.go @@ -11,12 +11,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Communication/api_subscriptions_collection_document_amf_status_change_notify_callback_document.go b/Namf_Communication/api_subscriptions_collection_document_amf_status_change_notify_callback_document.go index e842253b..da87774e 100644 --- a/Namf_Communication/api_subscriptions_collection_document_amf_status_change_notify_callback_document.go +++ b/Namf_Communication/api_subscriptions_collection_document_amf_status_change_notify_callback_document.go @@ -2,12 +2,13 @@ package Namf_Communication import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) type AmfStatusChangeCallbackDocumentApiService service diff --git a/Namf_Communication/client_debug.go b/Namf_Communication/client_debug.go deleted file mode 100644 index 2bff540d..00000000 --- a/Namf_Communication/client_debug.go +++ /dev/null @@ -1,82 +0,0 @@ -//+build debug - -/* - * Namf_Communication - * - * AMF Communication Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Namf_Communication - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the Namf_Communication API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - IndividualSubscriptionDocumentApi *IndividualSubscriptionDocumentApiService - IndividualUeContextDocumentApi *IndividualUeContextDocumentApiService - N1N2IndividualSubscriptionDocumentApi *N1N2IndividualSubscriptionDocumentApiService - N1N2MessageCollectionDocumentApi *N1N2MessageCollectionDocumentApiService - N1N2SubscriptionsCollectionForIndividualUEContextsDocumentApi *N1N2SubscriptionsCollectionForIndividualUEContextsDocumentApiService - N1N2MessageTransferStatusNotificationCallbackDocumentApi *N1N2MessageTransferStatusNotificationCallbackDocumentApiService - NonUEN2MessageNotificationIndividualSubscriptionDocumentApi *NonUEN2MessageNotificationIndividualSubscriptionDocumentApiService - NonUEN2MessagesCollectionDocumentApi *NonUEN2MessagesCollectionDocumentApiService - NonUEN2MessagesSubscriptionsCollectionDocumentApi *NonUEN2MessagesSubscriptionsCollectionDocumentApiService - SubscriptionsCollectionDocumentApi *SubscriptionsCollectionDocumentApiService - N1MessageNotifyCallbackDocumentApiServiceCallbackDocumentApi *N1MessageNotifyCallbackDocumentApiService - N2InfoNotifyCallbackDocumentApiServiceCallbackDocumentApi *N2InfoNotifyCallbackDocumentApiService - N2MessageNotifyCallbackDocumentApiServiceCallbackDocumentApi *N2MessageNotifyCallbackDocumentApiService - AmfStatusChangeCallbackDocumentApiServiceCallbackDocumentApi *AmfStatusChangeCallbackDocumentApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.IndividualSubscriptionDocumentApi = (*IndividualSubscriptionDocumentApiService)(&c.common) - c.IndividualUeContextDocumentApi = (*IndividualUeContextDocumentApiService)(&c.common) - c.N1N2IndividualSubscriptionDocumentApi = (*N1N2IndividualSubscriptionDocumentApiService)(&c.common) - c.N1N2MessageCollectionDocumentApi = (*N1N2MessageCollectionDocumentApiService)(&c.common) - c.N1N2SubscriptionsCollectionForIndividualUEContextsDocumentApi = (*N1N2SubscriptionsCollectionForIndividualUEContextsDocumentApiService)(&c.common) - c.N1N2MessageTransferStatusNotificationCallbackDocumentApi = (*N1N2MessageTransferStatusNotificationCallbackDocumentApiService)(&c.common) - c.NonUEN2MessageNotificationIndividualSubscriptionDocumentApi = (*NonUEN2MessageNotificationIndividualSubscriptionDocumentApiService)(&c.common) - c.NonUEN2MessagesCollectionDocumentApi = (*NonUEN2MessagesCollectionDocumentApiService)(&c.common) - c.NonUEN2MessagesSubscriptionsCollectionDocumentApi = (*NonUEN2MessagesSubscriptionsCollectionDocumentApiService)(&c.common) - c.SubscriptionsCollectionDocumentApi = (*SubscriptionsCollectionDocumentApiService)(&c.common) - c.N1MessageNotifyCallbackDocumentApiServiceCallbackDocumentApi = (*N1MessageNotifyCallbackDocumentApiService)(&c.common) - c.N2InfoNotifyCallbackDocumentApiServiceCallbackDocumentApi = (*N2InfoNotifyCallbackDocumentApiService)(&c.common) - c.N2MessageNotifyCallbackDocumentApiServiceCallbackDocumentApi = (*N2MessageNotifyCallbackDocumentApiService)(&c.common) - c.AmfStatusChangeCallbackDocumentApiServiceCallbackDocumentApi = (*AmfStatusChangeCallbackDocumentApiService)(&c.common) - return c -} diff --git a/Namf_Communication/logger/logger.go b/Namf_Communication/logger/logger.go deleted file mode 100644 index 45348a4e..00000000 --- a/Namf_Communication/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NamfCommLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"namf_communication.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NamfCommLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NamfComm"}) -} - -func SetLogLevel(level logrus.Level) { - NamfCommLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NamfCommLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Namf_EventExposure/api_individual_subscription_document.go b/Namf_EventExposure/api_individual_subscription_document.go index 75aa509e..cd9ed4d9 100644 --- a/Namf_EventExposure/api_individual_subscription_document.go +++ b/Namf_EventExposure/api_individual_subscription_document.go @@ -12,12 +12,13 @@ package Namf_EventExposure import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_EventExposure/api_subscriptions_collection_document.go b/Namf_EventExposure/api_subscriptions_collection_document.go index 12a0e439..2fc2bd47 100644 --- a/Namf_EventExposure/api_subscriptions_collection_document.go +++ b/Namf_EventExposure/api_subscriptions_collection_document.go @@ -11,12 +11,13 @@ package Namf_EventExposure import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_EventExposure/client_debug.go b/Namf_EventExposure/client_debug.go deleted file mode 100644 index 003338a7..00000000 --- a/Namf_EventExposure/client_debug.go +++ /dev/null @@ -1,57 +0,0 @@ - //+build debug - -/* - * Namf_EventExposure - * - * AMF Event Exposure Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Namf_EventExposure - -import ( - "crypto/tls" - "golang.org/x/net/http2" - "net/http" - "github.com/free5gc/http2_util" -) - -// APIClient manages communication with the Namf_EventExposure API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - IndividualSubscriptionDocumentApi *IndividualSubscriptionDocumentApiService - SubscriptionsCollectionDocumentApi *SubscriptionsCollectionDocumentApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.IndividualSubscriptionDocumentApi = (*IndividualSubscriptionDocumentApiService)(&c.common) - c.SubscriptionsCollectionDocumentApi = (*SubscriptionsCollectionDocumentApiService)(&c.common) - - return c -} diff --git a/Namf_EventExposure/logger/logger.go b/Namf_EventExposure/logger/logger.go deleted file mode 100644 index f8b79641..00000000 --- a/Namf_EventExposure/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NamfEventLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"namf_event_exposure.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NamfEventLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NamfEvent"}) -} - -func SetLogLevel(level logrus.Level) { - NamfEventLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NamfEventLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Namf_Location/api_individual_ue_context_document.go b/Namf_Location/api_individual_ue_context_document.go index 9f67189d..3e246e07 100644 --- a/Namf_Location/api_individual_ue_context_document.go +++ b/Namf_Location/api_individual_ue_context_document.go @@ -10,15 +10,15 @@ package _Namf_Location import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_Location/client_debug.go b/Namf_Location/client_debug.go deleted file mode 100644 index a6214d09..00000000 --- a/Namf_Location/client_debug.go +++ /dev/null @@ -1,55 +0,0 @@ - //+build debug - -/* - * Namf_Location - * - * AMF Location Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package _Namf_Location - -import ( - "crypto/tls" - "golang.org/x/net/http2" - "net/http" - "github.com/free5gc/http2_util" -) - -// APIClient manages communication with the Namf_Location API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - IndividualUEContextDocumentApi *IndividualUEContextDocumentApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.IndividualUEContextDocumentApi = (*IndividualUEContextDocumentApiService)(&c.common) - - return c -} diff --git a/Namf_MT/api_ue_context_document.go b/Namf_MT/api_ue_context_document.go index 60e19b3a..9a5dadcb 100644 --- a/Namf_MT/api_ue_context_document.go +++ b/Namf_MT/api_ue_context_document.go @@ -10,9 +10,6 @@ package Namf_MT import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_MT/api_ue_reach_ind_document.go b/Namf_MT/api_ue_reach_ind_document.go index 23266d38..e29cdb05 100644 --- a/Namf_MT/api_ue_reach_ind_document.go +++ b/Namf_MT/api_ue_reach_ind_document.go @@ -10,15 +10,15 @@ package Namf_MT import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Namf_MT/client_debug.go b/Namf_MT/client_debug.go deleted file mode 100644 index c5b7b54f..00000000 --- a/Namf_MT/client_debug.go +++ /dev/null @@ -1,57 +0,0 @@ - //+build debug - -/* - * Namf_MT - * - * AMF Mobile Termination Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Namf_MT - -import ( - "crypto/tls" - "golang.org/x/net/http2" - "net/http" - "github.com/free5gc/http2_util" -) - -// APIClient manages communication with the Namf_MT API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - UeContextDocumentApi *UeContextDocumentApiService - UeReachIndDocumentApi *UeReachIndDocumentApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.UeContextDocumentApi = (*UeContextDocumentApiService)(&c.common) - c.UeReachIndDocumentApi = (*UeReachIndDocumentApiService)(&c.common) - - return c -} diff --git a/Nausf_SoRProtection/api_default.go b/Nausf_SoRProtection/api_default.go index fa22f598..7c83ab43 100644 --- a/Nausf_SoRProtection/api_default.go +++ b/Nausf_SoRProtection/api_default.go @@ -10,15 +10,15 @@ package Nausf_SoRProtection import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nausf_SoRProtection/client_debug.go b/Nausf_SoRProtection/client_debug.go deleted file mode 100644 index 69be7ace..00000000 --- a/Nausf_SoRProtection/client_debug.go +++ /dev/null @@ -1,57 +0,0 @@ -//+build debug - -/* - * Nausf_SoRProtection Service - * - * AUSF SoR Protection Service - * - * API version: 1.0.1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nausf_SoRProtection - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the Nausf_SoRProtection Service API v1.0.1 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - DefaultApi *DefaultApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultApi = (*DefaultApiService)(&c.common) - - return c -} diff --git a/Nausf_UEAuthentication/api_default.go b/Nausf_UEAuthentication/api_default.go index de10bdf2..7a3977a8 100644 --- a/Nausf_UEAuthentication/api_default.go +++ b/Nausf_UEAuthentication/api_default.go @@ -10,9 +10,6 @@ package Nausf_UEAuthentication import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nausf_UEAuthentication/client_debug.go b/Nausf_UEAuthentication/client_debug.go deleted file mode 100644 index b4f57fe6..00000000 --- a/Nausf_UEAuthentication/client_debug.go +++ /dev/null @@ -1,57 +0,0 @@ -//+build debug - -/* - * AUSF API - * - * OpenAPI specification for AUSF - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nausf_UEAuthentication - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the AUSF API API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - DefaultApi *DefaultApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultApi = (*DefaultApiService)(&c.common) - - return c -} diff --git a/Nausf_UPUProtection/api_default.go b/Nausf_UPUProtection/api_default.go index b40a1374..985ab407 100644 --- a/Nausf_UPUProtection/api_default.go +++ b/Nausf_UPUProtection/api_default.go @@ -10,15 +10,15 @@ package Nausf_UPUProtection import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nausf_UPUProtection/client_debug.go b/Nausf_UPUProtection/client_debug.go deleted file mode 100644 index deec37ef..00000000 --- a/Nausf_UPUProtection/client_debug.go +++ /dev/null @@ -1,57 +0,0 @@ -//+build debug - -/* - * Nausf_UPUProtection Service - * - * AUSF UPU Protection Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nausf_UPUProtection - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the Nausf_UPUProtection Service API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - DefaultApi *DefaultApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultApi = (*DefaultApiService)(&c.common) - - return c -} diff --git a/Nnef_PFDmanagement/api_individual_application_pfd.go b/Nnef_PFDmanagement/api_individual_application_pfd.go index c05adc73..47072a9a 100644 --- a/Nnef_PFDmanagement/api_individual_application_pfd.go +++ b/Nnef_PFDmanagement/api_individual_application_pfd.go @@ -10,9 +10,6 @@ package Nnef_PFDmanagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnef_PFDmanagement/api_individual_pfd_subscription.go b/Nnef_PFDmanagement/api_individual_pfd_subscription.go index d88341e1..6b1baf85 100644 --- a/Nnef_PFDmanagement/api_individual_pfd_subscription.go +++ b/Nnef_PFDmanagement/api_individual_pfd_subscription.go @@ -10,15 +10,15 @@ package Nnef_PFDmanagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnef_PFDmanagement/api_notification.go b/Nnef_PFDmanagement/api_notification.go new file mode 100644 index 00000000..09ab3c7a --- /dev/null +++ b/Nnef_PFDmanagement/api_notification.go @@ -0,0 +1,182 @@ +package Nnef_PFDmanagement + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/free5gc/openapi" + . "github.com/free5gc/openapi/models" +) + +// Linger please +var ( + _ context.Context +) + +type NotificationApiService service + +/* +NotificationApiService Notifies about update to PFD change + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param notifyUri string - Notification URI provided in subscription + * @param pfdChangeNotifications []PfdChangeNotification - Notifications about updates to PFDs +*/ + +func (a *NotificationApiService) NotificationPost(ctx context.Context, notifyUri string, pfdChangeNotifications []PfdChangeNotification) ([]PfdChangeReport, *http.Response, error) { + var ( + localVarHTTPMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PfdChangeReport + ) + + // create path and map variables + localVarPath := notifyUri + "/notify" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarHTTPContentTypes := []string{"application/json"} + localVarHeaderParams["Content-Type"] = localVarHTTPContentTypes[0] // use the first content type specified in 'consumes' + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/problem+json"} + + // set Accept header + localVarHTTPHeaderAccept := openapi.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // body params + localVarPostBody = &pfdChangeNotifications + + r, err := openapi.PrepareRequest(ctx, a.client.cfg, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := openapi.CallAPI(a.client.cfg, r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + apiError := openapi.GenericOpenAPIError{ + RawBody: localVarBody, + ErrorStatus: localVarHTTPResponse.Status, + } + + switch localVarHTTPResponse.StatusCode { + case 200: + err = openapi.Deserialize(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + } + return localVarReturnValue, localVarHTTPResponse, nil + case 204: + return localVarReturnValue, localVarHTTPResponse, nil + case 400: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 401: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 403: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 404: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 411: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 413: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 415: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 429: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 500: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + case 503: + var v ProblemDetails + err = openapi.Deserialize(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + apiError.ErrorStatus = err.Error() + return localVarReturnValue, localVarHTTPResponse, nil + } + apiError.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, nil + default: + return localVarReturnValue, localVarHTTPResponse, nil + } +} diff --git a/Nnef_PFDmanagement/api_pfd_of_applications.go b/Nnef_PFDmanagement/api_pfd_of_applications.go index ec4e9694..2d360cd2 100644 --- a/Nnef_PFDmanagement/api_pfd_of_applications.go +++ b/Nnef_PFDmanagement/api_pfd_of_applications.go @@ -10,9 +10,6 @@ package Nnef_PFDmanagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" @@ -20,6 +17,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnef_PFDmanagement/api_pfd_subscriptions.go b/Nnef_PFDmanagement/api_pfd_subscriptions.go index aae9000e..a0124a4c 100644 --- a/Nnef_PFDmanagement/api_pfd_subscriptions.go +++ b/Nnef_PFDmanagement/api_pfd_subscriptions.go @@ -10,14 +10,14 @@ package Nnef_PFDmanagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnef_PFDmanagement/client.go b/Nnef_PFDmanagement/client.go index 1f3486ed..6ac5e3a3 100644 --- a/Nnef_PFDmanagement/client.go +++ b/Nnef_PFDmanagement/client.go @@ -27,6 +27,7 @@ type APIClient struct { IndividualPFDSubscriptionApi *IndividualPFDSubscriptionApiService PFDOfApplicationsApi *PFDOfApplicationsApiService PFDSubscriptionsApi *PFDSubscriptionsApiService + NotificationApi *NotificationApiService } type service struct { @@ -52,6 +53,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.IndividualPFDSubscriptionApi = (*IndividualPFDSubscriptionApiService)(&c.common) c.PFDOfApplicationsApi = (*PFDOfApplicationsApiService)(&c.common) c.PFDSubscriptionsApi = (*PFDSubscriptionsApiService)(&c.common) + c.NotificationApi = (*NotificationApiService)(&c.common) return c } diff --git a/Nnrf_AccessToken/api_access_token_request.go b/Nnrf_AccessToken/api_access_token_request.go index 16b4ab26..6db77d7b 100644 --- a/Nnrf_AccessToken/api_access_token_request.go +++ b/Nnrf_AccessToken/api_access_token_request.go @@ -10,9 +10,6 @@ package Nnrf_AccessToken import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" @@ -20,6 +17,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnrf_AccessToken/client_debug.go b/Nnrf_AccessToken/client_debug.go deleted file mode 100644 index 4b90b8e1..00000000 --- a/Nnrf_AccessToken/client_debug.go +++ /dev/null @@ -1,56 +0,0 @@ -//+build debug - -/* - * NRF OAuth2 - * - * NRF OAuth2 Authorization - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nnrf_AccessToken - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the NRF OAuth2 API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - AccessTokenRequestApi *AccessTokenRequestApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.AccessTokenRequestApi = (*AccessTokenRequestApiService)(&c.common) - - return c -} diff --git a/Nnrf_AccessToken/configuration.go b/Nnrf_AccessToken/configuration.go index 56a9bcd7..d1903571 100644 --- a/Nnrf_AccessToken/configuration.go +++ b/Nnrf_AccessToken/configuration.go @@ -12,7 +12,6 @@ package Nnrf_AccessToken import ( "net/http" "strings" - //"strings" ) type Configuration struct { diff --git a/Nnrf_NFDiscovery/api_nf_instances_store.go b/Nnrf_NFDiscovery/api_nf_instances_store.go index 17ae82b6..93780b60 100644 --- a/Nnrf_NFDiscovery/api_nf_instances_store.go +++ b/Nnrf_NFDiscovery/api_nf_instances_store.go @@ -10,9 +10,6 @@ package Nnrf_NFDiscovery import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" @@ -20,6 +17,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnrf_NFDiscovery/client_debug.go b/Nnrf_NFDiscovery/client_debug.go deleted file mode 100644 index 22020b98..00000000 --- a/Nnrf_NFDiscovery/client_debug.go +++ /dev/null @@ -1,57 +0,0 @@ -//+build debug - -/* - * NRF NFDiscovery Service - * - * NRF NFDiscovery Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nnrf_NFDiscovery - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the NRF NFDiscovery Service API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - NFInstancesStoreApi *NFInstancesStoreApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.NFInstancesStoreApi = (*NFInstancesStoreApiService)(&c.common) - - return c -} diff --git a/Nnrf_NFManagement/api_nf_instance_id_document.go b/Nnrf_NFManagement/api_nf_instance_id_document.go index 66ed088a..80bed28f 100644 --- a/Nnrf_NFManagement/api_nf_instance_id_document.go +++ b/Nnrf_NFManagement/api_nf_instance_id_document.go @@ -10,15 +10,15 @@ package Nnrf_NFManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnrf_NFManagement/api_nf_instances_store.go b/Nnrf_NFManagement/api_nf_instances_store.go index be96b785..1004fc21 100644 --- a/Nnrf_NFManagement/api_nf_instances_store.go +++ b/Nnrf_NFManagement/api_nf_instances_store.go @@ -10,9 +10,6 @@ package Nnrf_NFManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" @@ -20,6 +17,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnrf_NFManagement/api_subscription_id_document.go b/Nnrf_NFManagement/api_subscription_id_document.go index 7ba48f50..2fb6ba35 100644 --- a/Nnrf_NFManagement/api_subscription_id_document.go +++ b/Nnrf_NFManagement/api_subscription_id_document.go @@ -10,15 +10,15 @@ package Nnrf_NFManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnrf_NFManagement/api_subscriptions_collection.go b/Nnrf_NFManagement/api_subscriptions_collection.go index 4b625543..ffdc2483 100644 --- a/Nnrf_NFManagement/api_subscriptions_collection.go +++ b/Nnrf_NFManagement/api_subscriptions_collection.go @@ -10,14 +10,14 @@ package Nnrf_NFManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nnrf_NFManagement/client_debug.go b/Nnrf_NFManagement/client_debug.go deleted file mode 100644 index e540a535..00000000 --- a/Nnrf_NFManagement/client_debug.go +++ /dev/null @@ -1,65 +0,0 @@ -//+build debug - -/* - * NRF NFManagement Service - * - * NRF NFManagement Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nnrf_NFManagement - -import ( - "crypto/tls" - "net/http" - - "github.com/free5gc/http2_util" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the NRF NFManagement Service API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - NFInstanceIDDocumentApi *NFInstanceIDDocumentApiService - NFInstancesStoreApi *NFInstancesStoreApiService - SubscriptionIDDocumentApi *SubscriptionIDDocumentApiService - SubscriptionsCollectionApi *SubscriptionsCollectionApiService - NotificationApi *NotificationApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.NFInstanceIDDocumentApi = (*NFInstanceIDDocumentApiService)(&c.common) - c.NFInstancesStoreApi = (*NFInstancesStoreApiService)(&c.common) - c.SubscriptionIDDocumentApi = (*SubscriptionIDDocumentApiService)(&c.common) - c.SubscriptionsCollectionApi = (*SubscriptionsCollectionApiService)(&c.common) - c.NotificationApi = (*NotificationApiService)(&c.common) - return c -} diff --git a/Nnssf_NSSAIAvailability/logger/logger.go b/Nnssf_NSSAIAvailability/logger/logger.go deleted file mode 100644 index 13de1862..00000000 --- a/Nnssf_NSSAIAvailability/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NnssfNSSAIAvailabilityLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nnssf_nssai_availability.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NnssfNSSAIAvailabilityLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NnssfNSSAIAvail"}) -} - -func SetLogLevel(level logrus.Level) { - NnssfNSSAIAvailabilityLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NnssfNSSAIAvailabilityLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nnssf_NSSelection/logger/logger.go b/Nnssf_NSSelection/logger/logger.go deleted file mode 100644 index e24f5ccd..00000000 --- a/Nnssf_NSSelection/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NnssfNSSelectionLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nnssf_ns_selection.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NnssfNSSelectionLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NnssfNSSelect"}) -} - -func SetLogLevel(level logrus.Level) { - NnssfNSSelectionLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NnssfNSSelectionLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Npcf_AMPolicy/api_default.go b/Npcf_AMPolicy/api_default.go index d0758026..5afc8396 100644 --- a/Npcf_AMPolicy/api_default.go +++ b/Npcf_AMPolicy/api_default.go @@ -12,12 +12,13 @@ package Npcf_AMPolicy import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_AMPolicy/api_default_callback.go b/Npcf_AMPolicy/api_default_callback.go index 783cdc44..d20fd1a6 100644 --- a/Npcf_AMPolicy/api_default_callback.go +++ b/Npcf_AMPolicy/api_default_callback.go @@ -11,12 +11,13 @@ package Npcf_AMPolicy import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_BDTPolicyControl/api_bdt_policies_collection.go b/Npcf_BDTPolicyControl/api_bdt_policies_collection.go index 40bae64f..f8ba96da 100644 --- a/Npcf_BDTPolicyControl/api_bdt_policies_collection.go +++ b/Npcf_BDTPolicyControl/api_bdt_policies_collection.go @@ -10,14 +10,14 @@ package Npcf_BDTPolicyControl import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_BDTPolicyControl/api_individual_bdt_policy_document.go b/Npcf_BDTPolicyControl/api_individual_bdt_policy_document.go index 22f29ded..587c2140 100644 --- a/Npcf_BDTPolicyControl/api_individual_bdt_policy_document.go +++ b/Npcf_BDTPolicyControl/api_individual_bdt_policy_document.go @@ -10,15 +10,15 @@ package Npcf_BDTPolicyControl import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_PolicyAuthorization/api_application_sessions_collection.go b/Npcf_PolicyAuthorization/api_application_sessions_collection.go index 719089df..433ab0f0 100644 --- a/Npcf_PolicyAuthorization/api_application_sessions_collection.go +++ b/Npcf_PolicyAuthorization/api_application_sessions_collection.go @@ -11,12 +11,13 @@ package Npcf_PolicyAuthorization import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_PolicyAuthorization/api_eventNotification_callback.go b/Npcf_PolicyAuthorization/api_eventNotification_callback.go index ace74035..f8b1ccc4 100644 --- a/Npcf_PolicyAuthorization/api_eventNotification_callback.go +++ b/Npcf_PolicyAuthorization/api_eventNotification_callback.go @@ -11,12 +11,13 @@ package Npcf_PolicyAuthorization import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) type PolicyAuthorizationEventNotificationApiService service diff --git a/Npcf_PolicyAuthorization/api_events_subscription_document.go b/Npcf_PolicyAuthorization/api_events_subscription_document.go index ba6c1b8f..7fca86b0 100644 --- a/Npcf_PolicyAuthorization/api_events_subscription_document.go +++ b/Npcf_PolicyAuthorization/api_events_subscription_document.go @@ -12,12 +12,13 @@ package Npcf_PolicyAuthorization import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_PolicyAuthorization/api_individual_application_session_context_document.go b/Npcf_PolicyAuthorization/api_individual_application_session_context_document.go index 7ab7da9d..041f26f3 100644 --- a/Npcf_PolicyAuthorization/api_individual_application_session_context_document.go +++ b/Npcf_PolicyAuthorization/api_individual_application_session_context_document.go @@ -12,14 +12,15 @@ package Npcf_PolicyAuthorization import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_PolicyAuthorization/api_terminationRequest_callback.go b/Npcf_PolicyAuthorization/api_terminationRequest_callback.go index d59a8142..8437d1cb 100644 --- a/Npcf_PolicyAuthorization/api_terminationRequest_callback.go +++ b/Npcf_PolicyAuthorization/api_terminationRequest_callback.go @@ -11,12 +11,13 @@ package Npcf_PolicyAuthorization import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) type PolicyAuthorizationTerminateRequestApiService service diff --git a/Npcf_SMPolicyControl/api_dafult_notify_callback.go b/Npcf_SMPolicyControl/api_dafult_notify_callback.go index 7cd08c1b..3c90a52c 100644 --- a/Npcf_SMPolicyControl/api_dafult_notify_callback.go +++ b/Npcf_SMPolicyControl/api_dafult_notify_callback.go @@ -2,12 +2,13 @@ package Npcf_SMPolicyControl import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) type DefaultCallbackApi service diff --git a/Npcf_SMPolicyControl/api_default.go b/Npcf_SMPolicyControl/api_default.go index b3487a39..7efff705 100644 --- a/Npcf_SMPolicyControl/api_default.go +++ b/Npcf_SMPolicyControl/api_default.go @@ -10,15 +10,15 @@ package Npcf_SMPolicyControl import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_UEPolicy/api_default.go b/Npcf_UEPolicy/api_default.go index 9d07a114..9c77054f 100644 --- a/Npcf_UEPolicy/api_default.go +++ b/Npcf_UEPolicy/api_default.go @@ -12,11 +12,12 @@ package Npcf_UEPolicy import ( "context" "fmt" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Npcf_UEPolicy/client.go b/Npcf_UEPolicy/client.go index bbeaafc6..5fc8d836 100644 --- a/Npcf_UEPolicy/client.go +++ b/Npcf_UEPolicy/client.go @@ -12,6 +12,7 @@ package Npcf_UEPolicy import ( "bytes" "context" + "crypto/tls" "encoding/json" "encoding/xml" "errors" @@ -29,8 +30,6 @@ import ( "time" "unicode/utf8" - "crypto/tls" - "golang.org/x/net/http2" "golang.org/x/oauth2" ) diff --git a/Nsmf_EventExposure/api_default.go b/Nsmf_EventExposure/api_default.go index 90138271..042fb1cd 100644 --- a/Nsmf_EventExposure/api_default.go +++ b/Nsmf_EventExposure/api_default.go @@ -12,12 +12,13 @@ package Nsmf_EventExposure import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please @@ -25,8 +26,10 @@ var ( _ context.Context ) -type DefaultCallbackApi service -type DefaultApiService service +type ( + DefaultCallbackApi service + DefaultApiService service +) /* EventExposureNotification diff --git a/Nsmf_EventExposure/logger/logger.go b/Nsmf_EventExposure/logger/logger.go deleted file mode 100644 index 7a172dc6..00000000 --- a/Nsmf_EventExposure/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NsmfEventExposureLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nsmf_event_exposure.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NsmfEventExposureLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NsmfEvent"}) -} - -func SetLogLevel(level logrus.Level) { - NsmfEventExposureLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NsmfEventExposureLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nsmf_PDUSession/api_individual_pdu_session_hsmf.go b/Nsmf_PDUSession/api_individual_pdu_session_hsmf.go index 663bd546..f090e3be 100644 --- a/Nsmf_PDUSession/api_individual_pdu_session_hsmf.go +++ b/Nsmf_PDUSession/api_individual_pdu_session_hsmf.go @@ -12,14 +12,15 @@ package Nsmf_PDUSession import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nsmf_PDUSession/api_individual_sm_context.go b/Nsmf_PDUSession/api_individual_sm_context.go index 032d198a..44e661e9 100644 --- a/Nsmf_PDUSession/api_individual_sm_context.go +++ b/Nsmf_PDUSession/api_individual_sm_context.go @@ -12,14 +12,15 @@ package Nsmf_PDUSession import ( "context" "fmt" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nsmf_PDUSession/api_individual_sm_context_callback.go b/Nsmf_PDUSession/api_individual_sm_context_callback.go index c9aafd62..42f8f8a0 100644 --- a/Nsmf_PDUSession/api_individual_sm_context_callback.go +++ b/Nsmf_PDUSession/api_individual_sm_context_callback.go @@ -11,12 +11,13 @@ package Nsmf_PDUSession import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) type IndividualSMContextNotificationApiService service diff --git a/Nsmf_PDUSession/api_pdu_sessions_collection.go b/Nsmf_PDUSession/api_pdu_sessions_collection.go index 77f216d5..293412e8 100644 --- a/Nsmf_PDUSession/api_pdu_sessions_collection.go +++ b/Nsmf_PDUSession/api_pdu_sessions_collection.go @@ -11,12 +11,13 @@ package Nsmf_PDUSession import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nsmf_PDUSession/api_sm_contexts_collection.go b/Nsmf_PDUSession/api_sm_contexts_collection.go index aa2df6fe..f442e1c6 100644 --- a/Nsmf_PDUSession/api_sm_contexts_collection.go +++ b/Nsmf_PDUSession/api_sm_contexts_collection.go @@ -11,12 +11,13 @@ package Nsmf_PDUSession import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nsmf_PDUSession/client_debug.go b/Nsmf_PDUSession/client_debug.go deleted file mode 100644 index f112bb75..00000000 --- a/Nsmf_PDUSession/client_debug.go +++ /dev/null @@ -1,63 +0,0 @@ -//+build debug - -/* - * Nsmf_PDUSession - * - * SMF PDU Session Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nsmf_PDUSession - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the Nsmf_PDUSession API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - IndividualPDUSessionHSMFApi *IndividualPDUSessionHSMFApiService - IndividualSMContextApi *IndividualSMContextApiService - PDUSessionsCollectionApi *PDUSessionsCollectionApiService - SMContextsCollectionApi *SMContextsCollectionApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.IndividualPDUSessionHSMFApi = (*IndividualPDUSessionHSMFApiService)(&c.common) - c.IndividualSMContextApi = (*IndividualSMContextApiService)(&c.common) - c.PDUSessionsCollectionApi = (*PDUSessionsCollectionApiService)(&c.common) - c.SMContextsCollectionApi = (*SMContextsCollectionApiService)(&c.common) - - return c -} diff --git a/Nsmf_PDUSession/errors.go b/Nsmf_PDUSession/errors.go index 227883fb..658667a1 100644 --- a/Nsmf_PDUSession/errors.go +++ b/Nsmf_PDUSession/errors.go @@ -1,8 +1,9 @@ package Nsmf_PDUSession import ( - "github.com/free5gc/openapi/models" "net/http" + + "github.com/free5gc/openapi/models" ) var ( diff --git a/Nsmf_PDUSession/logger/logger.go b/Nsmf_PDUSession/logger/logger.go deleted file mode 100644 index aa57ca9e..00000000 --- a/Nsmf_PDUSession/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NsmfPDUSessionLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nsmf_pdu_session.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NsmfPDUSessionLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NsmfPDUSess"}) -} - -func SetLogLevel(level logrus.Level) { - NsmfPDUSessionLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NsmfPDUSessionLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nudm_EventExposure/api_create_ee_subscription.go b/Nudm_EventExposure/api_create_ee_subscription.go index 9420d552..aaedb49c 100644 --- a/Nudm_EventExposure/api_create_ee_subscription.go +++ b/Nudm_EventExposure/api_create_ee_subscription.go @@ -10,15 +10,15 @@ package Nudm_EventExposure import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_EventExposure/api_delete_ee_subscription.go b/Nudm_EventExposure/api_delete_ee_subscription.go index 396cd763..4277c56d 100644 --- a/Nudm_EventExposure/api_delete_ee_subscription.go +++ b/Nudm_EventExposure/api_delete_ee_subscription.go @@ -10,15 +10,15 @@ package Nudm_EventExposure import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_EventExposure/api_update_ee_subscription.go b/Nudm_EventExposure/api_update_ee_subscription.go index 93ee25f2..4113bf0d 100644 --- a/Nudm_EventExposure/api_update_ee_subscription.go +++ b/Nudm_EventExposure/api_update_ee_subscription.go @@ -10,15 +10,15 @@ package Nudm_EventExposure import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_EventExposure/logger/logger.go b/Nudm_EventExposure/logger/logger.go deleted file mode 100644 index 2be0e3e4..00000000 --- a/Nudm_EventExposure/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NudmEventExposureLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nudm_event_exposure.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NudmEventExposureLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NudmEvent"}) -} - -func SetLogLevel(level logrus.Level) { - NudmEventExposureLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NudmEventExposureLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nudm_ParameterProvision/api_subscription_data_update.go b/Nudm_ParameterProvision/api_subscription_data_update.go index ed2e8a84..896560c0 100644 --- a/Nudm_ParameterProvision/api_subscription_data_update.go +++ b/Nudm_ParameterProvision/api_subscription_data_update.go @@ -10,15 +10,15 @@ package Nudm_ParameterProvision import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_ParameterProvision/logger/logger.go b/Nudm_ParameterProvision/logger/logger.go deleted file mode 100644 index a694b1d1..00000000 --- a/Nudm_ParameterProvision/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NudmParameterProvisionLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nudm_parameter_provision.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NudmParameterProvisionLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NudmParam"}) -} - -func SetLogLevel(level logrus.Level) { - NudmParameterProvisionLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NudmParameterProvisionLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nudm_SubscriberDataManagement/api_access_and_mobility_subscription_data_retrieval.go b/Nudm_SubscriberDataManagement/api_access_and_mobility_subscription_data_retrieval.go index dffcd1fd..0b075945 100644 --- a/Nudm_SubscriberDataManagement/api_access_and_mobility_subscription_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_access_and_mobility_subscription_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_gpsi_to_supi_translation.go b/Nudm_SubscriberDataManagement/api_gpsi_to_supi_translation.go index b1db67ce..9b5ea573 100644 --- a/Nudm_SubscriberDataManagement/api_gpsi_to_supi_translation.go +++ b/Nudm_SubscriberDataManagement/api_gpsi_to_supi_translation.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_steering_of_roaming.go b/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_steering_of_roaming.go index 3f9638bd..21b2631c 100644 --- a/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_steering_of_roaming.go +++ b/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_steering_of_roaming.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_ue_parameters_update.go b/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_ue_parameters_update.go index b47f2571..cda565bb 100644 --- a/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_ue_parameters_update.go +++ b/Nudm_SubscriberDataManagement/api_providing_acknowledgement_of_ue_parameters_update.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_retrieval_of_multiple_data_sets.go b/Nudm_SubscriberDataManagement/api_retrieval_of_multiple_data_sets.go index b2715c9f..ae3936a8 100644 --- a/Nudm_SubscriberDataManagement/api_retrieval_of_multiple_data_sets.go +++ b/Nudm_SubscriberDataManagement/api_retrieval_of_multiple_data_sets.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_retrieval_of_shared_data.go b/Nudm_SubscriberDataManagement/api_retrieval_of_shared_data.go index 0b9220cb..4ab822cd 100644 --- a/Nudm_SubscriberDataManagement/api_retrieval_of_shared_data.go +++ b/Nudm_SubscriberDataManagement/api_retrieval_of_shared_data.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" @@ -20,6 +17,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_session_management_subscription_data_retrieval.go b/Nudm_SubscriberDataManagement/api_session_management_subscription_data_retrieval.go index e53c0e5e..f1e76ab4 100644 --- a/Nudm_SubscriberDataManagement/api_session_management_subscription_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_session_management_subscription_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_slice_selection_subscription_data_retrieval.go b/Nudm_SubscriberDataManagement/api_slice_selection_subscription_data_retrieval.go index 74b755a3..f94a69d1 100644 --- a/Nudm_SubscriberDataManagement/api_slice_selection_subscription_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_slice_selection_subscription_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_smf_selection_subscription_data_retrieval.go b/Nudm_SubscriberDataManagement/api_smf_selection_subscription_data_retrieval.go index cfad2b69..a23b4fa5 100644 --- a/Nudm_SubscriberDataManagement/api_smf_selection_subscription_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_smf_selection_subscription_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_sms_management_subscription_data_retrieval.go b/Nudm_SubscriberDataManagement/api_sms_management_subscription_data_retrieval.go index 7223bf9c..4513087a 100644 --- a/Nudm_SubscriberDataManagement/api_sms_management_subscription_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_sms_management_subscription_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_sms_subscription_data_retrieval.go b/Nudm_SubscriberDataManagement/api_sms_subscription_data_retrieval.go index 80ea8a78..250bad78 100644 --- a/Nudm_SubscriberDataManagement/api_sms_subscription_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_sms_subscription_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_subs_to_notification_data_change_notify_callback_document.go b/Nudm_SubscriberDataManagement/api_subs_to_notification_data_change_notify_callback_document.go index 5139bb97..2abb200a 100644 --- a/Nudm_SubscriberDataManagement/api_subs_to_notification_data_change_notify_callback_document.go +++ b/Nudm_SubscriberDataManagement/api_subs_to_notification_data_change_notify_callback_document.go @@ -2,12 +2,13 @@ package Nudm_SubscriberDataManagement import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_subscription_creation.go b/Nudm_SubscriberDataManagement/api_subscription_creation.go index a04209eb..dfe6850f 100644 --- a/Nudm_SubscriberDataManagement/api_subscription_creation.go +++ b/Nudm_SubscriberDataManagement/api_subscription_creation.go @@ -10,15 +10,15 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_subscription_creation_for_shared_data.go b/Nudm_SubscriberDataManagement/api_subscription_creation_for_shared_data.go index 15aee874..ef56846f 100644 --- a/Nudm_SubscriberDataManagement/api_subscription_creation_for_shared_data.go +++ b/Nudm_SubscriberDataManagement/api_subscription_creation_for_shared_data.go @@ -10,14 +10,14 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_subscription_deletion.go b/Nudm_SubscriberDataManagement/api_subscription_deletion.go index f88795f7..a9fd15c6 100644 --- a/Nudm_SubscriberDataManagement/api_subscription_deletion.go +++ b/Nudm_SubscriberDataManagement/api_subscription_deletion.go @@ -10,15 +10,15 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_subscription_deletion_for_shared_data.go b/Nudm_SubscriberDataManagement/api_subscription_deletion_for_shared_data.go index 601955cb..0658c6b3 100644 --- a/Nudm_SubscriberDataManagement/api_subscription_deletion_for_shared_data.go +++ b/Nudm_SubscriberDataManagement/api_subscription_deletion_for_shared_data.go @@ -10,15 +10,15 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_subscription_modification.go b/Nudm_SubscriberDataManagement/api_subscription_modification.go index 9b956d91..80b1f38b 100644 --- a/Nudm_SubscriberDataManagement/api_subscription_modification.go +++ b/Nudm_SubscriberDataManagement/api_subscription_modification.go @@ -10,15 +10,15 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_trace_configuration_data_retrieval.go b/Nudm_SubscriberDataManagement/api_trace_configuration_data_retrieval.go index 336e758e..1a0af27b 100644 --- a/Nudm_SubscriberDataManagement/api_trace_configuration_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_trace_configuration_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_ue_context_in_smf_data_retrieval.go b/Nudm_SubscriberDataManagement/api_ue_context_in_smf_data_retrieval.go index 08e646d5..17051c9d 100644 --- a/Nudm_SubscriberDataManagement/api_ue_context_in_smf_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_ue_context_in_smf_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/api_ue_context_in_smsf_data_retrieval.go b/Nudm_SubscriberDataManagement/api_ue_context_in_smsf_data_retrieval.go index ed089930..e4e232fc 100644 --- a/Nudm_SubscriberDataManagement/api_ue_context_in_smsf_data_retrieval.go +++ b/Nudm_SubscriberDataManagement/api_ue_context_in_smsf_data_retrieval.go @@ -10,9 +10,6 @@ package Nudm_SubscriberDataManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_SubscriberDataManagement/logger/logger.go b/Nudm_SubscriberDataManagement/logger/logger.go deleted file mode 100644 index 5fcf591c..00000000 --- a/Nudm_SubscriberDataManagement/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NudmSubscriberDataManagementLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nudm_subscriber_data_management.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NudmSubscriberDataManagementLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NudmSubscriber"}) -} - -func SetLogLevel(level logrus.Level) { - NudmSubscriberDataManagementLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NudmSubscriberDataManagementLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nudm_UEAuthentication/api_confirm_auth.go b/Nudm_UEAuthentication/api_confirm_auth.go index 87ad71b5..afa56acc 100644 --- a/Nudm_UEAuthentication/api_confirm_auth.go +++ b/Nudm_UEAuthentication/api_confirm_auth.go @@ -10,15 +10,15 @@ package Nudm_UEAuthentication import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEAuthentication/api_generate_auth_data.go b/Nudm_UEAuthentication/api_generate_auth_data.go index 19ed2146..ec5f17dd 100644 --- a/Nudm_UEAuthentication/api_generate_auth_data.go +++ b/Nudm_UEAuthentication/api_generate_auth_data.go @@ -10,15 +10,15 @@ package Nudm_UEAuthentication import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEAuthentication/logger/logger.go b/Nudm_UEAuthentication/logger/logger.go deleted file mode 100644 index 01b6a5b5..00000000 --- a/Nudm_UEAuthentication/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NudmUEAuthenticationLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nudm_ue_authentication.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NudmUEAuthenticationLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NudmUEAuth"}) -} - -func SetLogLevel(level logrus.Level) { - NudmUEAuthenticationLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NudmUEAuthenticationLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nudm_UEContextManagement/api_amf3_gpp_access_registration_info_retrieval.go b/Nudm_UEContextManagement/api_amf3_gpp_access_registration_info_retrieval.go index 642d054d..1b9ae19e 100644 --- a/Nudm_UEContextManagement/api_amf3_gpp_access_registration_info_retrieval.go +++ b/Nudm_UEContextManagement/api_amf3_gpp_access_registration_info_retrieval.go @@ -10,9 +10,6 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_amf_non3_gpp_access_registration_info_retrieval.go b/Nudm_UEContextManagement/api_amf_non3_gpp_access_registration_info_retrieval.go index 6d72df13..ef5c9be7 100644 --- a/Nudm_UEContextManagement/api_amf_non3_gpp_access_registration_info_retrieval.go +++ b/Nudm_UEContextManagement/api_amf_non3_gpp_access_registration_info_retrieval.go @@ -10,9 +10,6 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_amf_registration_for3_gpp_access.go b/Nudm_UEContextManagement/api_amf_registration_for3_gpp_access.go index be5dd04a..7f252e92 100644 --- a/Nudm_UEContextManagement/api_amf_registration_for3_gpp_access.go +++ b/Nudm_UEContextManagement/api_amf_registration_for3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_amf_registration_for_non3_gpp_access.go b/Nudm_UEContextManagement/api_amf_registration_for_non3_gpp_access.go index 0fee028f..dde5098c 100644 --- a/Nudm_UEContextManagement/api_amf_registration_for_non3_gpp_access.go +++ b/Nudm_UEContextManagement/api_amf_registration_for_non3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_deregistrationNotification.go b/Nudm_UEContextManagement/api_deregistrationNotification.go index 5008d83c..76d3e5a4 100644 --- a/Nudm_UEContextManagement/api_deregistrationNotification.go +++ b/Nudm_UEContextManagement/api_deregistrationNotification.go @@ -2,12 +2,13 @@ package Nudm_UEContextManagement import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please @@ -18,7 +19,6 @@ var ( type DeregistrationNotificationCallbackApiService service func (a *DeregistrationNotificationCallbackApiService) DeregistrationNotify(ctx context.Context, onDeregistrationNotifyUrl string, request models.DeregistrationData) (*http.Response, error) { - var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -95,5 +95,4 @@ func (a *DeregistrationNotificationCallbackApiService) DeregistrationNotify(ctx default: return localVarHttpResponse, openapi.ReportError("%d is not a valid status code in onDeregistrationNotification", localVarHttpResponse.StatusCode) } - } diff --git a/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for3_gpp_access.go b/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for3_gpp_access.go index 04cc1a75..ebe9b640 100644 --- a/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for3_gpp_access.go +++ b/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for_non3_gpp_access.go b/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for_non3_gpp_access.go index d7d2f11b..a4706c05 100644 --- a/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for_non3_gpp_access.go +++ b/Nudm_UEContextManagement/api_parameter_update_in_the_amf_registration_for_non3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smf_deregistration.go b/Nudm_UEContextManagement/api_smf_deregistration.go index f3facf00..06604791 100644 --- a/Nudm_UEContextManagement/api_smf_deregistration.go +++ b/Nudm_UEContextManagement/api_smf_deregistration.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smf_registration.go b/Nudm_UEContextManagement/api_smf_registration.go index a5d6ea82..7be5b16a 100644 --- a/Nudm_UEContextManagement/api_smf_registration.go +++ b/Nudm_UEContextManagement/api_smf_registration.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smsf3_gpp_access_registration_info_retrieval.go b/Nudm_UEContextManagement/api_smsf3_gpp_access_registration_info_retrieval.go index 69753ba3..2893f1dc 100644 --- a/Nudm_UEContextManagement/api_smsf3_gpp_access_registration_info_retrieval.go +++ b/Nudm_UEContextManagement/api_smsf3_gpp_access_registration_info_retrieval.go @@ -10,9 +10,6 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smsf_deregistration_for3_gpp_access.go b/Nudm_UEContextManagement/api_smsf_deregistration_for3_gpp_access.go index 2dcd38fd..07180de4 100644 --- a/Nudm_UEContextManagement/api_smsf_deregistration_for3_gpp_access.go +++ b/Nudm_UEContextManagement/api_smsf_deregistration_for3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smsf_deregistration_for_non3_gpp_access.go b/Nudm_UEContextManagement/api_smsf_deregistration_for_non3_gpp_access.go index 5744f90f..6ea6a635 100644 --- a/Nudm_UEContextManagement/api_smsf_deregistration_for_non3_gpp_access.go +++ b/Nudm_UEContextManagement/api_smsf_deregistration_for_non3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smsf_non3_gpp_access_registration_info_retrieval.go b/Nudm_UEContextManagement/api_smsf_non3_gpp_access_registration_info_retrieval.go index ae7ee661..d0d24fc4 100644 --- a/Nudm_UEContextManagement/api_smsf_non3_gpp_access_registration_info_retrieval.go +++ b/Nudm_UEContextManagement/api_smsf_non3_gpp_access_registration_info_retrieval.go @@ -10,9 +10,6 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smsf_registration_for3_gpp_access.go b/Nudm_UEContextManagement/api_smsf_registration_for3_gpp_access.go index c86b9680..52811295 100644 --- a/Nudm_UEContextManagement/api_smsf_registration_for3_gpp_access.go +++ b/Nudm_UEContextManagement/api_smsf_registration_for3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/api_smsf_registration_for_non3_gpp_access.go b/Nudm_UEContextManagement/api_smsf_registration_for_non3_gpp_access.go index 9fdd55c9..016b8352 100644 --- a/Nudm_UEContextManagement/api_smsf_registration_for_non3_gpp_access.go +++ b/Nudm_UEContextManagement/api_smsf_registration_for_non3_gpp_access.go @@ -10,15 +10,15 @@ package Nudm_UEContextManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudm_UEContextManagement/logger/logger.go b/Nudm_UEContextManagement/logger/logger.go deleted file mode 100644 index 6cb92722..00000000 --- a/Nudm_UEContextManagement/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NudmUEContextManagementLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nudm_ue_context_management.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NudmUEContextManagementLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NudmUEContext"}) -} - -func SetLogLevel(level logrus.Level) { - NudmUEContextManagementLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NudmUEContextManagementLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/Nudr_DataRepository/api_access_and_mobility_data.go b/Nudr_DataRepository/api_access_and_mobility_data.go index 66815144..08eb38c8 100644 --- a/Nudr_DataRepository/api_access_and_mobility_data.go +++ b/Nudr_DataRepository/api_access_and_mobility_data.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_access_and_mobility_subscription_data_document.go b/Nudr_DataRepository/api_access_and_mobility_subscription_data_document.go index 725d542c..a2936bf2 100644 --- a/Nudr_DataRepository/api_access_and_mobility_subscription_data_document.go +++ b/Nudr_DataRepository/api_access_and_mobility_subscription_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_amf3_gpp_access_registration_document.go b/Nudr_DataRepository/api_amf3_gpp_access_registration_document.go index c98a01da..78adfa9b 100644 --- a/Nudr_DataRepository/api_amf3_gpp_access_registration_document.go +++ b/Nudr_DataRepository/api_amf3_gpp_access_registration_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_amf_non3_gpp_access_registration_document.go b/Nudr_DataRepository/api_amf_non3_gpp_access_registration_document.go index c6d17b46..6316985b 100644 --- a/Nudr_DataRepository/api_amf_non3_gpp_access_registration_document.go +++ b/Nudr_DataRepository/api_amf_non3_gpp_access_registration_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_amf_subscription_info_document.go b/Nudr_DataRepository/api_amf_subscription_info_document.go index df67ac82..b6281c76 100644 --- a/Nudr_DataRepository/api_amf_subscription_info_document.go +++ b/Nudr_DataRepository/api_amf_subscription_info_document.go @@ -10,15 +10,15 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_auth_event_document.go b/Nudr_DataRepository/api_auth_event_document.go index dafa6a08..3f0503fd 100644 --- a/Nudr_DataRepository/api_auth_event_document.go +++ b/Nudr_DataRepository/api_auth_event_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_authentication_data_document.go b/Nudr_DataRepository/api_authentication_data_document.go index 71b1db5d..0814dcff 100644 --- a/Nudr_DataRepository/api_authentication_data_document.go +++ b/Nudr_DataRepository/api_authentication_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_authentication_so_r_document.go b/Nudr_DataRepository/api_authentication_so_r_document.go index 5ca4a054..38de6448 100644 --- a/Nudr_DataRepository/api_authentication_so_r_document.go +++ b/Nudr_DataRepository/api_authentication_so_r_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_authentication_status_document.go b/Nudr_DataRepository/api_authentication_status_document.go index 942ce5f9..6c096fb9 100644 --- a/Nudr_DataRepository/api_authentication_status_document.go +++ b/Nudr_DataRepository/api_authentication_status_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_create_amf_subscription_info_document.go b/Nudr_DataRepository/api_create_amf_subscription_info_document.go index 2b9f1dfa..3f388400 100644 --- a/Nudr_DataRepository/api_create_amf_subscription_info_document.go +++ b/Nudr_DataRepository/api_create_amf_subscription_info_document.go @@ -10,15 +10,15 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_default.go b/Nudr_DataRepository/api_default.go index b9a0dc35..9196d3ef 100644 --- a/Nudr_DataRepository/api_default.go +++ b/Nudr_DataRepository/api_default.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_event_amf_subscription_info_document.go b/Nudr_DataRepository/api_event_amf_subscription_info_document.go index d4bf69ea..678faa2a 100644 --- a/Nudr_DataRepository/api_event_amf_subscription_info_document.go +++ b/Nudr_DataRepository/api_event_amf_subscription_info_document.go @@ -12,11 +12,12 @@ package Nudr_DataRepository import ( "context" "fmt" - "github.com/free5gc/openapi" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" ) // Linger please diff --git a/Nudr_DataRepository/api_event_exposure_data_document.go b/Nudr_DataRepository/api_event_exposure_data_document.go index 211a3ede..f1c875e1 100644 --- a/Nudr_DataRepository/api_event_exposure_data_document.go +++ b/Nudr_DataRepository/api_event_exposure_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_event_exposure_group_subscriptions_collection.go b/Nudr_DataRepository/api_event_exposure_group_subscriptions_collection.go index 2d4ab598..67ce819f 100644 --- a/Nudr_DataRepository/api_event_exposure_group_subscriptions_collection.go +++ b/Nudr_DataRepository/api_event_exposure_group_subscriptions_collection.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_event_exposure_subscription_document.go b/Nudr_DataRepository/api_event_exposure_subscription_document.go index a8b11acb..1095eb47 100644 --- a/Nudr_DataRepository/api_event_exposure_subscription_document.go +++ b/Nudr_DataRepository/api_event_exposure_subscription_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_event_exposure_subscriptions_collection.go b/Nudr_DataRepository/api_event_exposure_subscriptions_collection.go index fcc1c91f..875e0956 100644 --- a/Nudr_DataRepository/api_event_exposure_subscriptions_collection.go +++ b/Nudr_DataRepository/api_event_exposure_subscriptions_collection.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_operator_specific_data_container_document.go b/Nudr_DataRepository/api_operator_specific_data_container_document.go index 0bc2f2c1..eac76483 100644 --- a/Nudr_DataRepository/api_operator_specific_data_container_document.go +++ b/Nudr_DataRepository/api_operator_specific_data_container_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_parameter_provision_document.go b/Nudr_DataRepository/api_parameter_provision_document.go index 8d97e1a6..59e1b50b 100644 --- a/Nudr_DataRepository/api_parameter_provision_document.go +++ b/Nudr_DataRepository/api_parameter_provision_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_pdu_session_management_data.go b/Nudr_DataRepository/api_pdu_session_management_data.go index bc588dcf..a53217ce 100644 --- a/Nudr_DataRepository/api_pdu_session_management_data.go +++ b/Nudr_DataRepository/api_pdu_session_management_data.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_provisioned_data_document.go b/Nudr_DataRepository/api_provisioned_data_document.go index 216b2483..2e33340f 100644 --- a/Nudr_DataRepository/api_provisioned_data_document.go +++ b/Nudr_DataRepository/api_provisioned_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_provisioned_parameter_data_document.go b/Nudr_DataRepository/api_provisioned_parameter_data_document.go index b90258bd..55d7fdf0 100644 --- a/Nudr_DataRepository/api_provisioned_parameter_data_document.go +++ b/Nudr_DataRepository/api_provisioned_parameter_data_document.go @@ -10,15 +10,15 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_query_amf_subscription_info_document.go b/Nudr_DataRepository/api_query_amf_subscription_info_document.go index 124d9358..abdbfdbb 100644 --- a/Nudr_DataRepository/api_query_amf_subscription_info_document.go +++ b/Nudr_DataRepository/api_query_amf_subscription_info_document.go @@ -10,15 +10,15 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_query_identity_data_by_supi_or_gpsi_document.go b/Nudr_DataRepository/api_query_identity_data_by_supi_or_gpsi_document.go index 4b5c2782..cd8af1fa 100644 --- a/Nudr_DataRepository/api_query_identity_data_by_supi_or_gpsi_document.go +++ b/Nudr_DataRepository/api_query_identity_data_by_supi_or_gpsi_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_query_odb_data_by_supi_or_gpsi_document.go b/Nudr_DataRepository/api_query_odb_data_by_supi_or_gpsi_document.go index 14f9d2b2..2aae5806 100644 --- a/Nudr_DataRepository/api_query_odb_data_by_supi_or_gpsi_document.go +++ b/Nudr_DataRepository/api_query_odb_data_by_supi_or_gpsi_document.go @@ -10,15 +10,15 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_retrieval_of_shared_data.go b/Nudr_DataRepository/api_retrieval_of_shared_data.go index 1e842c1c..16e73340 100644 --- a/Nudr_DataRepository/api_retrieval_of_shared_data.go +++ b/Nudr_DataRepository/api_retrieval_of_shared_data.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" @@ -20,6 +17,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_sdm_subscription_document.go b/Nudr_DataRepository/api_sdm_subscription_document.go index fd64c10d..451e4dd1 100644 --- a/Nudr_DataRepository/api_sdm_subscription_document.go +++ b/Nudr_DataRepository/api_sdm_subscription_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_sdm_subscriptions_collection.go b/Nudr_DataRepository/api_sdm_subscriptions_collection.go index 05682493..ba703a21 100644 --- a/Nudr_DataRepository/api_sdm_subscriptions_collection.go +++ b/Nudr_DataRepository/api_sdm_subscriptions_collection.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_session_management_subscription_data.go b/Nudr_DataRepository/api_session_management_subscription_data.go index 6fdfcf37..9d735f07 100644 --- a/Nudr_DataRepository/api_session_management_subscription_data.go +++ b/Nudr_DataRepository/api_session_management_subscription_data.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_smf_registration_document.go b/Nudr_DataRepository/api_smf_registration_document.go index b9169b05..4a96ad5e 100644 --- a/Nudr_DataRepository/api_smf_registration_document.go +++ b/Nudr_DataRepository/api_smf_registration_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_smf_registrations_collection.go b/Nudr_DataRepository/api_smf_registrations_collection.go index 989e5472..17ce9a1d 100644 --- a/Nudr_DataRepository/api_smf_registrations_collection.go +++ b/Nudr_DataRepository/api_smf_registrations_collection.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_smf_selection_subscription_data_document.go b/Nudr_DataRepository/api_smf_selection_subscription_data_document.go index dfd2ae2b..b3aa5bbf 100644 --- a/Nudr_DataRepository/api_smf_selection_subscription_data_document.go +++ b/Nudr_DataRepository/api_smf_selection_subscription_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_sms_management_subscription_data_document.go b/Nudr_DataRepository/api_sms_management_subscription_data_document.go index 5e37e91b..f260264a 100644 --- a/Nudr_DataRepository/api_sms_management_subscription_data_document.go +++ b/Nudr_DataRepository/api_sms_management_subscription_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_sms_subscription_data_document.go b/Nudr_DataRepository/api_sms_subscription_data_document.go index a19f402e..7e62843c 100644 --- a/Nudr_DataRepository/api_sms_subscription_data_document.go +++ b/Nudr_DataRepository/api_sms_subscription_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_smsf3_gpp_registration_document.go b/Nudr_DataRepository/api_smsf3_gpp_registration_document.go index eb25fb78..35200100 100644 --- a/Nudr_DataRepository/api_smsf3_gpp_registration_document.go +++ b/Nudr_DataRepository/api_smsf3_gpp_registration_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_smsf_non3_gpp_registration_document.go b/Nudr_DataRepository/api_smsf_non3_gpp_registration_document.go index b0429f45..c9e9b9b6 100644 --- a/Nudr_DataRepository/api_smsf_non3_gpp_registration_document.go +++ b/Nudr_DataRepository/api_smsf_non3_gpp_registration_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_subs_to_nofify_collection.go b/Nudr_DataRepository/api_subs_to_nofify_collection.go index e581dca2..44ae868d 100644 --- a/Nudr_DataRepository/api_subs_to_nofify_collection.go +++ b/Nudr_DataRepository/api_subs_to_nofify_collection.go @@ -10,14 +10,14 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_subs_to_nofify_data_change_notify_callback_document.go b/Nudr_DataRepository/api_subs_to_nofify_data_change_notify_callback_document.go index f4eb8fb5..82ac5529 100644 --- a/Nudr_DataRepository/api_subs_to_nofify_data_change_notify_callback_document.go +++ b/Nudr_DataRepository/api_subs_to_nofify_data_change_notify_callback_document.go @@ -2,12 +2,13 @@ package Nudr_DataRepository import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_subs_to_nofify_policy_data_change_notify_callback_document.go b/Nudr_DataRepository/api_subs_to_nofify_policy_data_change_notify_callback_document.go index ade8fcb8..006a8894 100644 --- a/Nudr_DataRepository/api_subs_to_nofify_policy_data_change_notify_callback_document.go +++ b/Nudr_DataRepository/api_subs_to_nofify_policy_data_change_notify_callback_document.go @@ -2,12 +2,13 @@ package Nudr_DataRepository import ( "context" - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/api_subs_to_notify_document.go b/Nudr_DataRepository/api_subs_to_notify_document.go index d16201e6..137fe295 100644 --- a/Nudr_DataRepository/api_subs_to_notify_document.go +++ b/Nudr_DataRepository/api_subs_to_notify_document.go @@ -12,14 +12,14 @@ package Nudr_DataRepository import ( // "github.com/free5gc/openapi/models" - "context" "fmt" - "github.com/free5gc/openapi" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" ) // Linger please diff --git a/Nudr_DataRepository/api_trace_data_document.go b/Nudr_DataRepository/api_trace_data_document.go index 13b36d1c..7edd76e6 100644 --- a/Nudr_DataRepository/api_trace_data_document.go +++ b/Nudr_DataRepository/api_trace_data_document.go @@ -10,9 +10,6 @@ package Nudr_DataRepository import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" @@ -21,6 +18,9 @@ import ( "strings" "github.com/antihax/optional" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/Nudr_DataRepository/client_debug.go b/Nudr_DataRepository/client_debug.go deleted file mode 100644 index eb0b11a8..00000000 --- a/Nudr_DataRepository/client_debug.go +++ /dev/null @@ -1,131 +0,0 @@ -//+build debug - -/* - * Nudr_DataRepository API OpenAPI file - * - * Unified Data Repository Service - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package Nudr_DataRepository - -import ( - "crypto/tls" - "github.com/free5gc/http2_util" - "net/http" - - "golang.org/x/net/http2" -) - -// APIClient manages communication with the Nudr_DataRepository API OpenAPI file API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - AMF3GPPAccessRegistrationDocumentApi *AMF3GPPAccessRegistrationDocumentApiService - AMFNon3GPPAccessRegistrationDocumentApi *AMFNon3GPPAccessRegistrationDocumentApiService - AccessAndMobilityDataApi *AccessAndMobilityDataApiService - AccessAndMobilitySubscriptionDataDocumentApi *AccessAndMobilitySubscriptionDataDocumentApiService - AmfSubscriptionInfoDocumentApi *AmfSubscriptionInfoDocumentApiService - AuthEventDocumentApi *AuthEventDocumentApiService - AuthenticationDataDocumentApi *AuthenticationDataDocumentApiService - AuthenticationSoRDocumentApi *AuthenticationSoRDocumentApiService - AuthenticationStatusDocumentApi *AuthenticationStatusDocumentApiService - CreateAMFSubscriptionInfoDocumentApi *CreateAMFSubscriptionInfoDocumentApiService - DefaultApi *DefaultApiService - EventAMFSubscriptionInfoDocumentApi *EventAMFSubscriptionInfoDocumentApiService - EventExposureDataDocumentApi *EventExposureDataDocumentApiService - EventExposureGroupSubscriptionsCollectionApi *EventExposureGroupSubscriptionsCollectionApiService - EventExposureSubscriptionDocumentApi *EventExposureSubscriptionDocumentApiService - EventExposureSubscriptionsCollectionApi *EventExposureSubscriptionsCollectionApiService - OperatorSpecificDataContainerDocumentApi *OperatorSpecificDataContainerDocumentApiService - ParameterProvisionDocumentApi *ParameterProvisionDocumentApiService - PduSessionManagementDataApi *PduSessionManagementDataApiService - ProvisionedDataDocumentApi *ProvisionedDataDocumentApiService - ProvisionedParameterDataDocumentApi *ProvisionedParameterDataDocumentApiService - QueryAMFSubscriptionInfoDocumentApi *QueryAMFSubscriptionInfoDocumentApiService - QueryIdentityDataBySUPIOrGPSIDocumentApi *QueryIdentityDataBySUPIOrGPSIDocumentApiService - QueryODBDataBySUPIOrGPSIDocumentApi *QueryODBDataBySUPIOrGPSIDocumentApiService - RetrievalOfSharedDataApi *RetrievalOfSharedDataApiService - SDMSubscriptionDocumentApi *SDMSubscriptionDocumentApiService - SDMSubscriptionsCollectionApi *SDMSubscriptionsCollectionApiService - SMFRegistrationDocumentApi *SMFRegistrationDocumentApiService - SMFRegistrationsCollectionApi *SMFRegistrationsCollectionApiService - SMFSelectionSubscriptionDataDocumentApi *SMFSelectionSubscriptionDataDocumentApiService - SMSF3GPPRegistrationDocumentApi *SMSF3GPPRegistrationDocumentApiService - SMSFNon3GPPRegistrationDocumentApi *SMSFNon3GPPRegistrationDocumentApiService - SMSManagementSubscriptionDataDocumentApi *SMSManagementSubscriptionDataDocumentApiService - SMSSubscriptionDataDocumentApi *SMSSubscriptionDataDocumentApiService - SessionManagementSubscriptionDataApi *SessionManagementSubscriptionDataApiService - SubsToNofifyCollectionApi *SubsToNofifyCollectionApiService - SubsToNotifyDocumentApi *SubsToNotifyDocumentApiService - TraceDataDocumentApi *TraceDataDocumentApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.httpClient == nil { - cfg.httpClient = http.DefaultClient - cfg.httpClient.Transport = &http2.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - Rand: http2_util.ZeroSource{}, - }, - } - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.AMF3GPPAccessRegistrationDocumentApi = (*AMF3GPPAccessRegistrationDocumentApiService)(&c.common) - c.AMFNon3GPPAccessRegistrationDocumentApi = (*AMFNon3GPPAccessRegistrationDocumentApiService)(&c.common) - c.AccessAndMobilityDataApi = (*AccessAndMobilityDataApiService)(&c.common) - c.AccessAndMobilitySubscriptionDataDocumentApi = (*AccessAndMobilitySubscriptionDataDocumentApiService)(&c.common) - c.AmfSubscriptionInfoDocumentApi = (*AmfSubscriptionInfoDocumentApiService)(&c.common) - c.AuthEventDocumentApi = (*AuthEventDocumentApiService)(&c.common) - c.AuthenticationDataDocumentApi = (*AuthenticationDataDocumentApiService)(&c.common) - c.AuthenticationSoRDocumentApi = (*AuthenticationSoRDocumentApiService)(&c.common) - c.AuthenticationStatusDocumentApi = (*AuthenticationStatusDocumentApiService)(&c.common) - c.CreateAMFSubscriptionInfoDocumentApi = (*CreateAMFSubscriptionInfoDocumentApiService)(&c.common) - c.DefaultApi = (*DefaultApiService)(&c.common) - c.EventAMFSubscriptionInfoDocumentApi = (*EventAMFSubscriptionInfoDocumentApiService)(&c.common) - c.EventExposureDataDocumentApi = (*EventExposureDataDocumentApiService)(&c.common) - c.EventExposureGroupSubscriptionsCollectionApi = (*EventExposureGroupSubscriptionsCollectionApiService)(&c.common) - c.EventExposureSubscriptionDocumentApi = (*EventExposureSubscriptionDocumentApiService)(&c.common) - c.EventExposureSubscriptionsCollectionApi = (*EventExposureSubscriptionsCollectionApiService)(&c.common) - c.OperatorSpecificDataContainerDocumentApi = (*OperatorSpecificDataContainerDocumentApiService)(&c.common) - c.ParameterProvisionDocumentApi = (*ParameterProvisionDocumentApiService)(&c.common) - c.PduSessionManagementDataApi = (*PduSessionManagementDataApiService)(&c.common) - c.ProvisionedDataDocumentApi = (*ProvisionedDataDocumentApiService)(&c.common) - c.ProvisionedParameterDataDocumentApi = (*ProvisionedParameterDataDocumentApiService)(&c.common) - c.QueryAMFSubscriptionInfoDocumentApi = (*QueryAMFSubscriptionInfoDocumentApiService)(&c.common) - c.QueryIdentityDataBySUPIOrGPSIDocumentApi = (*QueryIdentityDataBySUPIOrGPSIDocumentApiService)(&c.common) - c.QueryODBDataBySUPIOrGPSIDocumentApi = (*QueryODBDataBySUPIOrGPSIDocumentApiService)(&c.common) - c.RetrievalOfSharedDataApi = (*RetrievalOfSharedDataApiService)(&c.common) - c.SDMSubscriptionDocumentApi = (*SDMSubscriptionDocumentApiService)(&c.common) - c.SDMSubscriptionsCollectionApi = (*SDMSubscriptionsCollectionApiService)(&c.common) - c.SMFRegistrationDocumentApi = (*SMFRegistrationDocumentApiService)(&c.common) - c.SMFRegistrationsCollectionApi = (*SMFRegistrationsCollectionApiService)(&c.common) - c.SMFSelectionSubscriptionDataDocumentApi = (*SMFSelectionSubscriptionDataDocumentApiService)(&c.common) - c.SMSF3GPPRegistrationDocumentApi = (*SMSF3GPPRegistrationDocumentApiService)(&c.common) - c.SMSFNon3GPPRegistrationDocumentApi = (*SMSFNon3GPPRegistrationDocumentApiService)(&c.common) - c.SMSManagementSubscriptionDataDocumentApi = (*SMSManagementSubscriptionDataDocumentApiService)(&c.common) - c.SMSSubscriptionDataDocumentApi = (*SMSSubscriptionDataDocumentApiService)(&c.common) - c.SessionManagementSubscriptionDataApi = (*SessionManagementSubscriptionDataApiService)(&c.common) - c.SubsToNofifyCollectionApi = (*SubsToNofifyCollectionApiService)(&c.common) - c.SubsToNotifyDocumentApi = (*SubsToNotifyDocumentApiService)(&c.common) - c.TraceDataDocumentApi = (*TraceDataDocumentApiService)(&c.common) - - return c -} diff --git a/Nudr_DataRepository/logger/logger.go b/Nudr_DataRepository/logger/logger.go deleted file mode 100644 index 8c2a89ab..00000000 --- a/Nudr_DataRepository/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var NudrDataRepositoryLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"nudr_data_repository.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - NudrDataRepositoryLog = log.WithFields(logrus.Fields{"component": "OAPI", "category": "NudrDataRepo"}) -} - -func SetLogLevel(level logrus.Level) { - NudrDataRepositoryLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - NudrDataRepositoryLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/PfdManagement/api_default.go b/PfdManagement/api_default.go index da41a4aa..552e98a2 100644 --- a/PfdManagement/api_default.go +++ b/PfdManagement/api_default.go @@ -10,15 +10,15 @@ package PfdManagement import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/TrafficInfluence/api_traffic_influence_api_subscription_level_delete_operation.go b/TrafficInfluence/api_traffic_influence_api_subscription_level_delete_operation.go index 6a73f383..b9e1f32f 100644 --- a/TrafficInfluence/api_traffic_influence_api_subscription_level_delete_operation.go +++ b/TrafficInfluence/api_traffic_influence_api_subscription_level_delete_operation.go @@ -10,15 +10,15 @@ package TrafficInfluence import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/TrafficInfluence/api_traffic_influence_api_subscription_level_get_operation.go b/TrafficInfluence/api_traffic_influence_api_subscription_level_get_operation.go index b0bc0ebd..44643f03 100644 --- a/TrafficInfluence/api_traffic_influence_api_subscription_level_get_operation.go +++ b/TrafficInfluence/api_traffic_influence_api_subscription_level_get_operation.go @@ -10,15 +10,15 @@ package TrafficInfluence import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/TrafficInfluence/api_traffic_influence_api_subscription_level_patch_operation.go b/TrafficInfluence/api_traffic_influence_api_subscription_level_patch_operation.go index b304ec3f..23d6ebf5 100644 --- a/TrafficInfluence/api_traffic_influence_api_subscription_level_patch_operation.go +++ b/TrafficInfluence/api_traffic_influence_api_subscription_level_patch_operation.go @@ -10,15 +10,15 @@ package TrafficInfluence import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/TrafficInfluence/api_traffic_influence_api_subscription_level_post_operation.go b/TrafficInfluence/api_traffic_influence_api_subscription_level_post_operation.go index 5e919762..0132ed0b 100644 --- a/TrafficInfluence/api_traffic_influence_api_subscription_level_post_operation.go +++ b/TrafficInfluence/api_traffic_influence_api_subscription_level_post_operation.go @@ -10,15 +10,15 @@ package TrafficInfluence import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/TrafficInfluence/api_traffic_influence_api_subscription_level_put_operation.go b/TrafficInfluence/api_traffic_influence_api_subscription_level_put_operation.go index c04d5d33..13e3690d 100644 --- a/TrafficInfluence/api_traffic_influence_api_subscription_level_put_operation.go +++ b/TrafficInfluence/api_traffic_influence_api_subscription_level_put_operation.go @@ -10,15 +10,15 @@ package TrafficInfluence import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/TrafficInfluence/api_traffic_influence_apiscsas_level_get_operation.go b/TrafficInfluence/api_traffic_influence_apiscsas_level_get_operation.go index e426e59f..bfcbbe52 100644 --- a/TrafficInfluence/api_traffic_influence_apiscsas_level_get_operation.go +++ b/TrafficInfluence/api_traffic_influence_apiscsas_level_get_operation.go @@ -10,15 +10,15 @@ package TrafficInfluence import ( - "github.com/free5gc/openapi" - "github.com/free5gc/openapi/models" - "context" "fmt" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/free5gc/openapi" + "github.com/free5gc/openapi/models" ) // Linger please diff --git a/client.go b/client.go index 791a4996..c5729628 100644 --- a/client.go +++ b/client.go @@ -33,7 +33,6 @@ import ( "golang.org/x/net/http2" "golang.org/x/oauth2" - "gopkg.in/h2non/gock.v1" ) @@ -154,6 +153,7 @@ func parseMultipartFieldParameters(str string) (contentType string, ref string, } return } + func getContentID(v reflect.Value, ref string, class string) (contentID string, err error) { recursiveVal := v if ref[0] == '{' { @@ -237,6 +237,7 @@ func getContentID(v reflect.Value, ref string, class string) (contentID string, contentID = recursiveVal.String() return } + func MultipartEncode(v interface{}, body io.Writer) (string, error) { val := reflect.Indirect(reflect.ValueOf(v)) w := multipart.NewWriter(body) @@ -499,7 +500,6 @@ func PrepareRequest( } func MultipartDeserialize(b []byte, v interface{}, boundary string) (err error) { - body := bytes.NewReader(b) r := multipart.NewReader(body, boundary) val := reflect.Indirect(reflect.ValueOf(v)) diff --git a/convert_test.go b/convert_test.go index ce5eb3fa..eae9de89 100644 --- a/convert_test.go +++ b/convert_test.go @@ -1,7 +1,6 @@ -package openapi_test +package openapi import ( - "github.com/free5gc/openapi" "testing" "time" @@ -31,7 +30,7 @@ func TestConvert(t *testing.T) { var to Struct - err := openapi.Convert(from, &to) + err := Convert(from, &to) assert.Nil(t, err, "convert failed") // check data is correct @@ -45,5 +44,4 @@ func TestConvert(t *testing.T) { }, to.M) expectTime, err := time.Parse(time.RFC3339, "2020-05-01T12:04:05+08:00") assert.Equal(t, expectTime, *to.DT) - } diff --git a/go.mod b/go.mod index a1494a63..c7047aa3 100644 --- a/go.mod +++ b/go.mod @@ -4,16 +4,10 @@ go 1.14 require ( github.com/antihax/optional v1.0.0 - github.com/antonfisher/nested-logrus-formatter v1.3.0 github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/free5gc/http2_util v1.0.0 - github.com/free5gc/logger_conf v1.0.0 - github.com/free5gc/logger_util v1.0.0 - github.com/mitchellh/mapstructure v1.4.0 - github.com/sirupsen/logrus v1.7.0 - github.com/stretchr/testify v1.6.1 - golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 - golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 - google.golang.org/appengine v1.6.7 // indirect - gopkg.in/h2non/gock.v1 v1.0.16 + github.com/mitchellh/mapstructure v1.4.1 + github.com/stretchr/testify v1.7.0 + golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d + golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 + gopkg.in/h2non/gock.v1 v1.1.2 ) diff --git a/go.sum b/go.sum index 88042e0b..184911a2 100644 --- a/go.sum +++ b/go.sum @@ -35,48 +35,23 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonfisher/nested-logrus-formatter v1.3.0 h1:8zixYquU1Odk+vzAaAQPAdRh1ZjmUXNQ1T+dUBvlhVo= -github.com/antonfisher/nested-logrus-formatter v1.3.0/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/free5gc/http2_util v1.0.0 h1:0laMypHUNizAE5zsLoeJQq0R4XrfbvsLCW4NHCPpc44= -github.com/free5gc/http2_util v1.0.0/go.mod h1:GN2BCD8IINjtnAKYGwe+dEeTBRFEv4lQnZblFIIhbdE= -github.com/free5gc/logger_conf v1.0.0 h1:cMqqB8L4HjE57tP36mBmiVUPIcHv8Ayr12jKfeiwqZU= -github.com/free5gc/logger_conf v1.0.0/go.mod h1:DHecLXVV1qA5Z+lSoUvZdZ6tCtZidTNmtx99jsCfgLE= -github.com/free5gc/logger_util v1.0.0 h1:hLTCTnKlEqJURrBwooNFQLavWPdJzS0o9KGIYUNKdJI= -github.com/free5gc/logger_util v1.0.0/go.mod h1:TK/bAJbm/l2TMNmbsKn83+xUmDNqts69IEir/nCa8w0= -github.com/free5gc/path_util v1.0.0 h1:vJPGTymaWtavz6fJ/7k6WKEYv5BQLAq/O04RP54sab0= -github.com/free5gc/path_util v1.0.0/go.mod h1:OpmcebEKrMPnH7Jg5lZ8y9ZWJNAjQ4l9FGWXUv58Mo0= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -102,8 +77,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -114,7 +87,6 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -132,10 +104,6 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplb github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -144,44 +112,18 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.1 h1:dz+JxTe7GZQdErTo7SREc1jQj/hFP1k7jyIAwODoW+k= -github.com/ugorji/go v1.2.1/go.mod h1:cSVypSfTLm2o9fKxXvQgn3rMmkPXovcWor6Qn5tbFmI= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.1 h1:/TRfW3XKkvWvmAYyCUaQlhoCDGjcvNR8xVVA/l5p/jQ= -github.com/ugorji/go/codec v1.2.1/go.mod h1:s/WxCRi46t8rA+fowL40EnmD7ec0XhR7ZypxeBNdzsM= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -195,8 +137,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -239,7 +179,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -254,15 +193,15 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -281,11 +220,9 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -297,22 +234,18 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 h1:B6caxRw+hozq68X2MY7jEpZh/cr4/aHLv9xU8Kkadrw= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0= -golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -384,8 +317,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -442,14 +373,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/h2non/gentleman.v1 v1.0.4/go.mod h1:JYuHVdFzS4MKOXe0o+chKJ4hCe6tqKKw9XH9YP6WFrg= -gopkg.in/h2non/gock.v1 v1.0.16 h1:F11k+OafeuFENsjei5t2vMTSTs9L62AdyTe4E1cgdG8= -gopkg.in/h2non/gock.v1 v1.0.16/go.mod h1:XVuDAssexPLwgxCLMvDTWNU5eqklsydR6I5phZ9oPB8= +gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/logger/logger.go b/logger/logger.go deleted file mode 100644 index d0c4f804..00000000 --- a/logger/logger.go +++ /dev/null @@ -1,50 +0,0 @@ -package logger - -import ( - "os" - "time" - - formatter "github.com/antonfisher/nested-logrus-formatter" - "github.com/sirupsen/logrus" - - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" -) - -var log *logrus.Logger -var OpenApiLog *logrus.Entry - -func init() { - log = logrus.New() - log.SetReportCaller(false) - - log.Formatter = &formatter.Formatter{ - TimestampFormat: time.RFC3339, - TrimMessages: true, - NoFieldsSpace: true, - HideKeys: true, - FieldsOrder: []string{"component", "category"}, - } - - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.LibLogDir+"openapi.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - - OpenApiLog = log.WithFields(logrus.Fields{"component": "LIB", "category": "OAPI"}) -} - -func SetLogLevel(level logrus.Level) { - OpenApiLog.Infoln("set log level :", level) - log.SetLevel(level) -} - -func SetReportCaller(bool bool) { - OpenApiLog.Infoln("set report call :", bool) - log.SetReportCaller(bool) -} diff --git a/models/model_atom.go b/models/model_atom.go old mode 100755 new mode 100644 diff --git a/models/model_cnf.go b/models/model_cnf.go old mode 100755 new mode 100644 diff --git a/models/model_cnf_unit.go b/models/model_cnf_unit.go old mode 100755 new mode 100644 diff --git a/models/model_complex_query.go b/models/model_complex_query.go old mode 100755 new mode 100644 diff --git a/models/model_dnf.go b/models/model_dnf.go old mode 100755 new mode 100644 diff --git a/models/model_dnf_unit.go b/models/model_dnf_unit.go old mode 100755 new mode 100644 diff --git a/problem_details.go b/problem_details.go new file mode 100644 index 00000000..ff89fc33 --- /dev/null +++ b/problem_details.go @@ -0,0 +1,32 @@ +package openapi + +import ( + "net/http" + + "github.com/free5gc/openapi/models" +) + +func ProblemDetailsSystemFailure(detail string) *models.ProblemDetails { + return &models.ProblemDetails{ + Title: "System failure", + Status: http.StatusInternalServerError, + Detail: detail, + Cause: "SYSTEM_FAILURE", + } +} + +func ProblemDetailsMalformedReqSyntax(detail string) *models.ProblemDetails { + return &models.ProblemDetails{ + Title: "Malformed request syntax", + Status: http.StatusBadRequest, + Detail: detail, + } +} + +func ProblemDetailsDataNotFound(detail string) *models.ProblemDetails { + return &models.ProblemDetails{ + Title: "Data not found", + Status: http.StatusNotFound, + Detail: detail, + } +} diff --git a/serialize.go b/serialize.go index 2934efe2..b3b3157b 100644 --- a/serialize.go +++ b/serialize.go @@ -4,8 +4,6 @@ import ( "encoding/json" "encoding/xml" "errors" - - "github.com/free5gc/openapi/logger" ) // Serialize - serialize data v to corresponding media type @@ -20,10 +18,7 @@ func Serialize(v interface{}, mediaType string) ([]byte, error) { case MediaKindMultipartRelated: b, _, err = MultipartSerialize(v) default: - if err = errors.New("openapi client not supported serialize media type: " + mediaType); err != nil { - logger.OpenApiLog.Warnf("Error encode failed: %v", err) - return nil, err - } + return nil, errors.New("openapi client not supported serialize media type: " + mediaType) } return b, err } diff --git a/supported_feature_test.go b/supported_feature_test.go new file mode 100644 index 00000000..479dbe04 --- /dev/null +++ b/supported_feature_test.go @@ -0,0 +1,89 @@ +package openapi + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestNewSupportedFeature(t *testing.T) { + suppFeat, err := NewSupportedFeature("03") + assert.Nil(t, err, "") + assert.Equal(t, SupportedFeature{0x03}, suppFeat) + + suppFeat, err = NewSupportedFeature("03FF") + assert.Nil(t, err, "") + assert.Equal(t, SupportedFeature{0x03, 0xFF}, suppFeat) + + suppFeat, err = NewSupportedFeature("0324") + assert.Nil(t, err, "") + assert.Equal(t, SupportedFeature{0x03, 0x24}, suppFeat) + + // error case + suppFeat, err = NewSupportedFeature("ZXCD") + assert.NotNil(t, err, "should retrun error") + assert.Equal(t, SupportedFeature{}, suppFeat) +} +func TestGetFeatureOfSupportedFeature(t *testing.T) { + suppFeat, _ := NewSupportedFeature("1324") + + assert.False(t, suppFeat.GetFeature(1)) + assert.False(t, suppFeat.GetFeature(2)) + assert.True(t, suppFeat.GetFeature(3)) + assert.False(t, suppFeat.GetFeature(4)) + + assert.False(t, suppFeat.GetFeature(5)) + assert.True(t, suppFeat.GetFeature(6)) + assert.False(t, suppFeat.GetFeature(7)) + assert.False(t, suppFeat.GetFeature(8)) + + assert.True(t, suppFeat.GetFeature(9)) + assert.True(t, suppFeat.GetFeature(10)) + assert.False(t, suppFeat.GetFeature(11)) + assert.False(t, suppFeat.GetFeature(12)) + + assert.True(t, suppFeat.GetFeature(13)) + assert.False(t, suppFeat.GetFeature(14)) + assert.False(t, suppFeat.GetFeature(15)) + assert.False(t, suppFeat.GetFeature(16)) +} + +func TestStringOfSupportedFeature(t *testing.T) { + suppFeat, _ := NewSupportedFeature("1324") + assert.Equal(t, "1324", suppFeat.String()) + + // testing padding + suppFeat, _ = NewSupportedFeature("1") + assert.Equal(t, "01", suppFeat.String()) + + suppFeat, _ = NewSupportedFeature("ABCDE") + assert.Equal(t, "0abcde", suppFeat.String()) +} + +func TestNegotiateWithOfSupportedFeature(t *testing.T) { + var suppFeatA, suppFeatB, negotiatedFeat SupportedFeature + suppFeatA, _ = NewSupportedFeature("0FFF") + suppFeatB, _ = NewSupportedFeature("1324") + negotiatedFeat = suppFeatA.NegotiateWith(suppFeatB) + assert.Equal(t, SupportedFeature{0x03, 0x24}, negotiatedFeat) + + suppFeatA, _ = NewSupportedFeature("0234") + suppFeatB, _ = NewSupportedFeature("0001") + negotiatedFeat = suppFeatA.NegotiateWith(suppFeatB) + assert.Equal(t, SupportedFeature{0x00, 0x00}, negotiatedFeat) + + suppFeatA, _ = NewSupportedFeature("FFFF") + suppFeatB, _ = NewSupportedFeature("F") + negotiatedFeat = suppFeatA.NegotiateWith(suppFeatB) + assert.Equal(t, SupportedFeature{0x00, 0x0F}, negotiatedFeat) + + suppFeatA, _ = NewSupportedFeature("3000") + suppFeatB, _ = NewSupportedFeature("3") + negotiatedFeat = suppFeatA.NegotiateWith(suppFeatB) + assert.Equal(t, SupportedFeature{0x00, 0x00}, negotiatedFeat) + + suppFeatA, _ = NewSupportedFeature("23E3") + suppFeatB, _ = NewSupportedFeature("1") + negotiatedFeat = suppFeatA.NegotiateWith(suppFeatB) + assert.Equal(t, SupportedFeature{0x00, 0x01}, negotiatedFeat) +}